DEV Community

Discussion on: How to Create and Publish a React Component Library

Collapse
 
matthiasnannt profile image
Matthias Nannt

Hi @samiulhsohan
I faced the same problem and found a solution. This is what causes the error:
blog.maximeheckel.com/posts/duplic...

And this is my next.config.js that solves the issue:

var path = require("path");

module.exports = {
  webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
    config.resolve.alias["react"] = path.resolve("./node_modules/react");
    return config;
  },
};
Enter fullscreen mode Exit fullscreen mode

Some comments have been hidden by the post's author - find out more