Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fresh NextJS App throwing errors before any changes

Tags:

next.js

I literally did "npx create-next-app", cd appfolder, npm run dev, and it's blowing out errors already:

(node:7636) [DEP_WEBPACK_MODULE_ISSUER] DeprecationWarning: Module.issuer: Use new ModuleGraph API
(Use `node --trace-deprecation ...` to show where the warning was created)
error - ./styles/globals.css
Global CSS cannot be imported from files other than your Custom <App>. Due to the Global nature of stylesheets, and to avoid conflicts, Please move all first-party global CSS imports to pages/_app.js. Or convert the import to Component-Level CSS (CSS Modules).
Read more: https://nextjs.org/docs/messages/css-global
Location: pages\_app.js

Module list:
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

node -v = v14.17.5

So a virgin npx create-next-app, and it can't even stand up on it's own. I'm very new to NextJS / NodeJS, but not new to programming, IT, web development. Shouldn't this be able to start without blowing up before I even change anything???

like image 434
JJJ Avatar asked Aug 31 '21 00:08

JJJ


Video Answer


1 Answers

I was experiencing the exact same issue as you described, and for what I’ve found, it seems to be due to a breaking change in [email protected] which is only affecting Windows.

Until this gets fixed, you can downgrade Next to version 11.1.0:

npm install [email protected]

yarn add [email protected]

like image 84
Rodrigo D'Agostino Avatar answered Oct 18 '22 06:10

Rodrigo D'Agostino