YIZHUANG / react-multi-carousel

A lightweight production-ready Carousel that rocks supports multiple items and server-side rendering with no dependency. Bundle size 2kb.
MIT License
1.25k stars 286 forks source link

importing css in next js throws error while build #294

Closed Sahejmaharjan1 closed 2 years ago

Sahejmaharjan1 commented 2 years ago

I'm importing css in _app file in next js. import 'react-multi-carousel/lib/styles.css'; when trying to build I get error:


./node_modules/react-multi-carousel/lib/styles.css
HookWebpackError: Module parse failed: Unexpected character '' (1:4)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
-- inner error --
Error: Module parse failed: Unexpected character '' (1:4)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
Generated code for /Users/sahejmaharjan/NextJs/preparie/node_modules/react-multi-carousel/lib/revicons.woff
PeterMain commented 2 years ago

same here!

jlkwarteng commented 2 years ago

Was this ever resolved?

jlkwarteng commented 2 years ago

@PeterMain @Sahejmaharjan1 Did you find a solution to this.

YIZHUANG commented 2 years ago

Please check the documentation of next js, you need css support in your nextjs project, it's documented there