Next.js error Global CSS cannot be imported from within node_modules.
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 201
- Avg merge
- 12m
- Merged PRs (30d)
- 1
Description
I have followed each and every step mentioned Here , but always I get:
error - ./node_modules/@uiw/react-markdown-preview/esm/styles/markdown.css
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules\@uiw\react-markdown-preview\esm\index.js
Import trace for requested module:
./node_modules/@uiw/react-markdown-preview/esm/styles/markdown.css
./node_modules/@uiw/react-markdown-preview/esm/index.js
./node_modules/@uiw/react-md-editor/esm/Editor.js
./node_modules/@uiw/react-md-editor/esm/index.js
./components/Contact.tsx
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Next.js setup described in the linked support guide and inspect the import trace from components/Contact.tsx through @uiw/react-md-editor and @uiw/react-markdown-preview. Compare the failing CSS import under node_modules with the package entry points; done means the documented setup builds without the Global CSS error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js, react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100