Chapter 2 import style not working
copying the code and importing global css does nothing to update the style.
instead of
import '@app/ui/global.css'
try
import '../app/ui/global.css'
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
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
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)
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'
Looks like this was resolved