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

Chapter 2 import style not working #846

Open
amyming112 opened this issue Aug 24, 2024 · 5 comments
Open

Chapter 2 import style not working #846

amyming112 opened this issue Aug 24, 2024 · 5 comments

Comments

@amyming112
Copy link

amyming112 commented Aug 24, 2024

copying the code and importing global css does nothing to update the style.

Screenshot 2024-08-25 at 00 48 57 Screenshot 2024-08-25 at 00 48 43
@eiffel205566
Copy link

instead of

import '@app/ui/global.css'

try

import '../app/ui/global.css'

@amyming112
Copy link
Author

amyming112 commented Aug 25, 2024

Thanks. I tried a few different imports, including the import style from .. (from 2nd part of the tutorial), and I keep getting the below. same for chroms and safari.

I have imported the latest NextJS(as per the demo code) and npm i installed everything. also tried npm i canary, but got a loooooong error message about unable to resolve dependencies

Screenshot 2024-08-25 at 10 48 55

@eiffel205566
Copy link

eiffel205566 commented Aug 25, 2024

you shouldn't be running
npm i

the doc is using "pnpm" (install thru npm)
https://nextjs.org/learn/dashboard-app/getting-started#running-the-development-server

might wanna start from beginning or delete your node_modules and rerun pnpm i

@LuamB
Copy link

LuamB commented Aug 27, 2024

I had the same issue, probably bc I ran npm i accidentally, but then I quit the process ctl c and ran pnpm i, so I thought it should be fine.
Anyways, deleting node_modules and running pnpm i again solved the issue, but there's still a warning in the terminal:

(node:11645) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use node --trace-warnings ... to show where the warning was created)

@GreytownSnowy
Copy link

I managed to get Chapter 2 working by changing:
import styles from '@/app/ui/home.module.css';
to
import styles from './ui/home.module.css'

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

4 participants