Skip to content

Global CSS cannot be imported from within node_modules. #7170

Open
@pldrouin

Description

@pldrouin

Hi,
I get the following error with 2.35.2 when I try building with npm run build. It seems to be related to #7139 and #7145. What do I need to change to fix this error?

Thanks!

▲ Next.js 14.2.11

✓ Linting and checking validity of types
Creating an optimized production build ...
(node:8736) [DEP_WEBPACK_MODULE_ISSUER] DeprecationWarning: Module.issuer: Use new ModuleGraph API
(Use node --trace-deprecation ... to show where the warning was created)
Failed to compile.

./node_modules/maplibre-gl/dist/maplibre-gl.css
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/plotly.js/src/registry.js

Import trace for requested module:
./node_modules/maplibre-gl/dist/maplibre-gl.css
./node_modules/plotly.js/src/registry.js
./node_modules/plotly.js/src/core.js
./node_modules/plotly.js/lib/core.js
./src/plotly-custom.js
./components/PlotlyChartDynamicLoad.js
./components/PlotlyChart.js

./node_modules/maplibre-gl/dist/maplibre-gl.css

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2considered for next cyclebugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions