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

ModuleNotFoundError: Module not found: Error: Can't resolve 'react-multi-carousel/lib/styles.css' #282

Closed rogereiddir closed 2 years ago

rogereiddir commented 2 years ago

this Error accurs when tryiing to deploy to vercel or heroku can any one help me with this?

.babelrc

{
    "presets": ["next/babel"],
    "plugins": [["styled-components", { "ssr": true }]]
}

next.config.js

const withPlugins = require('next-compose-plugins');
const withOptimizedImages = require('next-optimized-images');
// next.js configuration
const nextConfig = {
  async redirects() {
    return [
      {
        source: '/',
        destination: '/home',
        permanent: false,
      },
    ];
  },
};

module.exports = withPlugins([withOptimizedImages] , nextConfig);
umanga907 commented 2 years ago

do not use the newest version. I just had the same issue. On the new version there is no lib folder nor there is any styles.css file. you can change it to older version and run npm install or yarn install again.

@YIZHUANG please look into this issue, its breaking a lot of build and the documentation has not been updated yet.

YIZHUANG commented 2 years ago

Should work now