Within my .storybook/main.js
file, I've included the following webpack configuration:
webpackFinal: async (config) => {
config.resolve.modules = [
...(config.resolve.modules || []),
path.resolve(__dirname),
];
return config;
},
However, upon running my storybook, I encounter an error:
Error message:
resolve 'components/Common/Button' in '/myprojectpath/pages'
Parsed request is a module
using description file: /myprojectpath/package.json (relative path: ./pages)
Field 'browser' doesn't contain a valid alias configuration
resolve as module
/myprojectpath/pages/node_modules doesn't exist or is not a directory
looking for modules in /myprojectpath/node_modules
I'm unsure of why this issue is occurring. Interestingly, the Next.js project runs without any problems.
Your help is greatly appreciated!