antvis / antvis/Graphin

[NextJs@11] Global CSS cannot be imported from within node_modules.

Open
#399 1 comment 7 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.1k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

Hi, thanks for your great work of this library. I'm trying to use it in my NextJs app but it throws an error. Seems like NextJs doesn't support importing CSS from node_modules so could you separate style from the index.js? Thanks in advance.

BTW, the full error information is [here](https://github.com/vercel/next.js/blob/master/errors/css-npm.md).

### Your Example Website or App

null

### Steps to Reproduce the Bug or Issue

npm run build

### Expected behavior

编译成功

### Screenshots or Videos

_No response_

### Platform

- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start in the package entry point referenced by the report, index.js, and reproduce the problem with npm run build in a Next.js 11 app. Trace the CSS import that originates from node_modules and separate it from the entry point; done means the build completes without the global-CSS error.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.