storybookjs / testing-vue3

Testing utilities that allow you to reuse your stories in your unit tests
16 stars 7 forks source link

Storybook 7.6 is not supported #14

Closed raphael-yapla closed 6 months ago

raphael-yapla commented 11 months ago

Describe the bug The 7.6 update and more specifically this MR broke the package. The ./preview entry point used by this package has been removed and so now the following error is thrown when including it:

Error: Package subpath './preview' is not defined by "exports" in /node_modules/@storybook/vue3/package.json
 ❯ Object.<anonymous> node_modules/@storybook/testing-vue3/dist/testing-vue3.cjs.development.js:7:33

I'm using the following setup:

    "@storybook/addon-essentials": "^7.6.0",
    "@storybook/addon-interactions": "^7.6.0",
    "@storybook/addon-links": "^7.6.0",
    "@storybook/blocks": "^7.6.0",
    "@storybook/testing-vue3": "^1.0.0",
    "@storybook/vue3": "^7.6.0",
    "@storybook/vue3-vite": "^7.6.0",
    ...
    "storybook": "^7.6.0",
    "typescript": "^5.3.2",
    "vite": "^5.0.2",
    "vitest": "^0.34.6",

To Reproduce Do a test with Storybook 7.6 including the package and run it

Expected behavior I'm guessing the import should be updated.

Additional context More of an additional question, the release log mention that you'd like to put the functionality of this package in @storybook/vue3. Do you have any updates on this? I feel like it would have helped avoiding that issue.

Xenossolitarius commented 11 months ago

// @ts-ignore import * as vueDefaultConfig from '@storybook/vue3/dist/entry-preview.mjs'

this would resolve the export

Xenossolitarius commented 11 months ago

@raphael-yapla https://github.com/storybookjs/testing-vue3/pull/15 this should fix it

raphael-yapla commented 11 months ago

@Xenossolitarius Incredible, thank you so much for submitting that! Here's hoping the Storybook team can review it sometime soon :)

vanessayuenn commented 9 months ago

@yannbf does https://github.com/storybookjs/storybook/pull/25443 resolve this issue also?

yannbf commented 9 months ago

@vanessayuenn yes it fixes the './preview' is not defined by "exports" issue but not the 7.6 incompatibility (unless we patch it and make another 7.6.x release)

vanessayuenn commented 6 months ago

Closing this as testing-vue3 is now available on Storybook 8