2

I followed documentation of react-slick step by step.

I installed both react-slick and slick-carousel but whenever I import the css i always get this error Module not found: Can't resolve '~slick-carousel/slick/slick-theme.css'

also this error Global CSS cannot be imported from files other than your Custom <App>. Please move all global CSS imports to src/pages/_app.js. Or convert the import to Component-Level CSS (CSS Modules)

I'm using Reactjs with nextJS

Any suggestions please?

Nika Roffy
  • 891
  • 2
  • 8
  • 20
  • I tried it here [https://stackblitz.com/edit/react-functional-boilerplate-16-13-1-6xjtu8?file=index.js] and it works well. I just removed the tilde (~) before the css imports, the same that throw you an error – Quentin Grisel Sep 20 '20 at 09:26
  • Did you import in the local component or the root ? – Nika Roffy Sep 20 '20 at 09:28
  • I tried doing that but it is giving me the second error about Global css – Nika Roffy Sep 20 '20 at 09:29
  • Now it gave me this error `ExtractPluginMissingException: svg-sprite-loader exception. svg-sprite-loader in extract mode requires the corresponding plugin` – Nika Roffy Sep 20 '20 at 09:30
  • It seems that I have answered your same question at https://stackoverflow.com/a/63988376/2145213 – nghiaht Sep 21 '20 at 09:53

0 Answers0