Fresh NextJS App throwing errors before any changes

Viewed 5724

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:

  • eslint-config-next@11.1.1
  • eslint@7.32.0
  • next@11.1.1
  • react-dom@17.0.2
  • react@17.0.2

node -v = v14.17.5

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 next@11.1.1 which is only affecting Windows.

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

npm install next@11.1.0

yarn add next@11.1.0

Related