plotly / plotly/plotly.js

Global CSS cannot be imported from within node_modules.

Offen
#7,170 3 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug P2
Vorherrschende Sprache
JavaScript
Sterne
18.3k
Forks
2k
Ø Merge
2 T. 12 Std.
Gemergte PRs (30 T.)
28

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere den Fehler mit npm run build und folge dem Import-Trace von node_modules/maplibre-gl/dist/maplibre-gl.css über node_modules/plotly.js/src/registry.js bis zu src/plotly-custom.js und den PlotlyChart-Komponenten. Lies die zugehörigen Issues #7139 und #7145 und überprüfe anschließend, dass der gemeldete Build ohne den Global CSS-Fehler abgeschlossen wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
css, javascript, nextjs
Bereich
data-visualization, frontend
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.