question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove CSS import in order to support Next.js

See original GitHub issue

Hi, I’m trying to use this component in a Next.js application, but the code fails to compile due to this error:

./node_modules/react-datasheet-grid/dist/style.css
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/react-datasheet-grid/dist/components/DataSheetGrid.js

See https://nextjs.org/docs/messages/css-npm

Would it be possible to remove the CSS import and allow developers to instead import the CSS in their own projects (to control how the CSS is consumed/injected)?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
nick-kellercommented, Jan 26, 2022

Alright, 4.0.0 is live 😉

2reactions
nick-kellercommented, Jan 26, 2022

Hello @iacobfred @cholazzzb lveillard, This will be live in less than 24h, this will be a v4 as it is not backward compatible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Basic Features: Built-in CSS Support - Next.js
Next.js allows you to import CSS files from a JavaScript file. This is possible because Next.js extends the concept of import beyond JavaScript....
Read more >
Verify CSS import ordering · Issue #16630 · vercel/next.js
A user on twitter reported that Next.js may not order CSS imports from JS correctly. We need to investigate and fix this!
Read more >
Next.js Global CSS cannot be imported from files other than ...
I've tried to remove new files I've added along with their code, but this doesn't fix the problem. I've also tried what the...
Read more >
next-remove-imports - npm
This is a plugin for nextjs. The default behavior is to remove all .less / .css / .scss / .sass / .styl imports...
Read more >
Global vs. Local Styling In Next.js - Smashing Magazine
Then, we can import style from ./TeaListItem.module.css in our TeaListitem component. The style variable comes in like a JavaScript object, so ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found