Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get import statements to work using the tilde (~) #2

Closed
rstudner opened this issue May 26, 2023 · 0 comments
Closed

Can't get import statements to work using the tilde (~) #2

rstudner opened this issue May 26, 2023 · 0 comments

Comments

@rstudner
Copy link

rstudner commented May 26, 2023

The path "/components/NewNote" is imported in app/routes/notes.jsx but "/components/NewNote" was not found in your node_modules. Did you forget to install it?
✘ [ERROR] Could not resolve "~/components/NewNote"

app/routes/notes.jsx:1:20:
  1 │ import NewNote from '~/components/NewNote';
    ╵                     ~~~~~~~~~~~~~~~~~~~~~~

You can mark the path "~/components/NewNote" as external to exclude it from the bundle, which will remove this error.

I also noticed that your slides reference a remix.config.js that is different from the one here in github (but trying either doesn't change the error)

As well, the npx create-remix added:
// import { cssBundleHref } from "@remix-run/css-bundle";
and
// export const links = () => [
// ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
// ];

and I commented those out in favor of the course's method of doing links etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant