ReactLibraries / storybook-addon-module-mock

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

Vue compatibility #4

Closed marcoarruda closed 1 year ago

marcoarruda commented 1 year ago

Despite the fact it's a React library (sorry, I noticed just after installing and trying to use, because it is listed in storybook integration addons)

I'm trying to use with vue3 / ts / vite but I get the following error:

Screenshot 2023-03-31 at 13 47 26

I could use it in my stories, though I found out I should remove it from the list of addons:

"addons": [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-interactions",
    // 'storybook-addon-module-mock',

If it was not supposed to work with Vue, is there any side projects for this? This addon is very handful, thanks for it

Not sure if it's a valid workaround, or maybe there is something I missed. Here it is the repo I'm working on: https://github.com/marcoarruda/frontend-api-tasks-books

SoraKumo001 commented 1 year ago

Package.json should be set to "type": "commonjs" and main.js should be set to builder: "webpack5".