[Bug]: Error: Cannot find module '@storybook/experimental-addon-test/internal/coverage-reporter'
in monorepo setups
#29785
Labels
In certain monorepo scenarios, Vitest can fail to resolve
@storybook/experimental-addon-test/internal/coverage-reporter
if it has been hoisted or similar. We are not in control of this resolution, we simply pass in a string to a custom coverage reporter. See docs at:https://vitest.dev/guide/coverage.html#custom-coverage-reporter
The problem is here on line 45:
storybook/code/addons/test/src/node/vitest-manager.ts
Lines 44 to 50 in 08dca94
We could try to use
require.resolve
(or the ESM equivalent) to get an absolute path at runtime (relative to the current file) instead of referencing the export of our package.Reproduction
https://github.com/gawdfrey/storybook-experimental-monorepo
npm install
npm run build
npm run dev
localhost:6006
and try to run a test with coverage enabled, you should see error in console.The text was updated successfully, but these errors were encountered: