ReactLibraries / storybook-addon-module-mock

Provides module mocking functionality like jest.mock on Storybook.
MIT License
42 stars 5 forks source link

Module resolution errors #20

Open PaulineVolvo opened 1 month ago

PaulineVolvo commented 1 month ago

I encountered multiple module resolution errors when trying to use the storybook-addon-module-mock addon with my Storybook setup. The errors indicate that certain Storybook internal modules cannot be found. Below are the details of the issue.

ERROR in ../../node_modules/storybook-addon-module-mock/node_modules/@storybook/instrumenter/dist/index.mjs 1:0-56
Module not found: Error: Can't resolve 'storybook/internal/preview-api' in '/path/to/project/node_modules/storybook-addon-module-mock/node_modules/@storybook/instrumenter/dist'
 @ ../../node_modules/storybook-addon-module-mock/node_modules/@storybook/test/dist/index.mjs 1:0-53 179:93-103 182:2340-2350 182:2400-2410
 @ ../../node_modules/storybook-addon-module-mock/dist/esm/mocks/index.js 2:0-44 4:18-20 5:4-16
 @ ../../node_modules/storybook-addon-module-mock/dist/esm/index.js 2:0-33 2:0-33
 @ ../../shared/car-selector/components/car-card/wholesale-car-card.stories.tsx 9:0-57 44:19-29
 @ ./storybook-stories.js 64:11-68:5
 @ ./storybook-config-entry.js 8:0-50 20:31-39 27:2-30:4 27:58-30:3 29:31-39

ERROR in ../../node_modules/storybook-addon-module-mock/node_modules/@storybook/instrumenter/dist/index.mjs 2:0-56
Module not found: Error: Can't resolve 'storybook/internal/client-logger' in '/path/to/project/node_modules/storybook-addon-module-mock/node_modules/@storybook/instrumenter/dist'

The project uses Webpack as the bundler. Anyone has any idea how to solve this ?