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

After 0.18 upgrade, css imports show error #291

Closed
Graham42 opened this issue Sep 28, 2021 · 4 comments
Closed

After 0.18 upgrade, css imports show error #291

Graham42 opened this issue Sep 28, 2021 · 4 comments

Comments

@Graham42
Copy link
Contributor

After the 0.18 upgrade, I noticed my css imports showing TypeScript errors, for example:

Cannot find module '../styles/index.css' or its corresponding type declarations.

Currently the 0.18 release uprade instructions say to add this line to the tsconfig.json file

{
  "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"]
}

But if the tsconfig.json file is in the app/ folder, then "remix.env.d.ts" is not resolved. This can be fixed by changing the include statement to

{
  "include": ["../remix.env.d.ts", "**/*.ts", "**/*.tsx"]
}

I spun up a new test project with npm init remix and I see that the tsconfig.json file is now in the root of the project by default, so I think the 0.18 release notes are missing step to move app/tsconfig.json to the root of the project.

@machour
Copy link
Collaborator

machour commented Mar 16, 2022

Not applicable anymore

@joshuagraber
Copy link

joshuagraber commented Oct 27, 2022

Why is this not applicable anymore? I'm using 1.6.7 and keep getting import errors with CSS files. Have tried this solution and it feels like a zillion others, no luck. is there any documentation on how to solve this?

Edit: re-ran my build script, which cleans cache and other generated files first, and now it's okay? Strange behavior, though. If anyone knows why it might be happening occasionally, I'm curious.

@nabeelpkl
Copy link

facing same issue, how can I solve this?

@machour
Copy link
Collaborator

machour commented Jan 24, 2023

@nabeelpkl please open a new Q&A question in the discussion tab.

@remix-run remix-run locked as resolved and limited conversation to collaborators Jan 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants