We develop a library for React components. The library is set up as a lerna-monorepo with multiple packages. I recently adopted Storybook with vite and ran into the following error:
Failed to resolve entry for package "OurComponent". The package may have incorrect main/module/exports specified in its package.json.
So when I changed these entries in the corresponding package.json:
{
"main": "dist/index.js",
"module": "dist/index.es.js",
"jsnext:main": "dist/index.es.js",
"files": [
"dist"
],
"types": "dist/index.d.ts",
"source": "index.ts"
}
to this:
{
"main": "index.ts",
"source": "index.ts"
}
the error went away. However these fields are needed for publishing to our node-registry! I can't imagine that I'm the first one to have this problem, but I also didn't find any documentation about how this is generally solved. Can anyone help me out with that?