storybook-vue / storybook-nuxt

Deprecated in favor of https://github.com/nuxt-modules/storybook/
https://github.com/nuxt-modules/storybook/
134 stars 20 forks source link

Is yarn berry supported? #82

Closed bmulholland closed 9 months ago

bmulholland commented 11 months ago

The whole thing isn't running for me when upgrading my project to Nuxt 3. I tried to install this using the exact package versions in an example Stackblitz, https://stackblitz.com/edit/github-dxsw3r-tjesvx, but I'm getting:

=> Failed to build the preview
Error: Cannot find @storybook/vue3-vite,

It is installed though:

    "@nuxtjs/storybook": "7.0.0",
    "@storybook-vue/nuxt": "0.1.7",
    "@storybook/addon-essentials": "7.5.0-alpha.3",
    "@storybook/addon-interactions": "7.5.0-alpha.3",
    "@storybook/addon-links": "7.5.0-alpha.3",
    "@storybook/blocks": "7.5.0-alpha.3",
    "@storybook/builder-vite": "7.5.0-alpha.3",
    "@storybook/testing-library": "^0.2.0",
    "@storybook/vue3": "7.5.0-alpha.3",
    "@types/node": "^18.17.5",
    "nuxt": "^3.6.5",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "storybook": "7.5.0-alpha.3",
    "vue": "^3.3.4",
    "vue-router": "^4.2.5",
    "@storybook-vue/vue3-vite" :"7.5.0-alpha.3.0",
    "@vue/compiler-core": "3.3.4",
    "vite": "4.3.9",

It's in node_modules too.

I'd post a minimal repro, except stackblitz doesn't support modern yarn.

bmulholland commented 11 months ago

BTW, trying all this because I can't get any version using "latest" running either. This happens: https://github.com/storybook-vue/storybook-nuxt/issues/76

Now trying with the exact package.json from https://github.com/storybook-vue/storybook-nuxt-demo

I tried those and I still get the same error from before:

 ERROR  At least one <template> or <script> is required in a single file component.                       4:59:22 p.m.

 ERROR  Transform failed with 1 error:                                                                    4:59:23 p.m.
83:7: ERROR: Multiple exports with the same name "default"
...
 ERROR  Transform failed with 2 errors:                                                                   4:59:23 p.m.
app.vue:36:6: ERROR: The symbol "_hoisted_1" has already been declared
app.vue:69:7: ERROR: Multiple exports with the same name "default"

These are all valid files.

Considering I'm using the exact same files as that demo, I have to assume the problem is yarn. Again, I'd narrow it down more, but stackblitz won't work. If someone can post a repro system on a tool that supports modern package management, I'll try that out.

peteromano commented 10 months ago

Pnpm works fine

chakAs3 commented 9 months ago

i did not yet work on Yarn , Yarn berry issue. please use pnpm till i fix this issue. use

{
    "private": true,
    "type": "module",
    "scripts": {
        "build": "nuxt build",
        "dev": "HOST=0.0.0.0 nuxt dev",
        "generate": "nuxt generate",
        "preview": "nuxt preview",
        "postinstall": "nuxt prepare",
        "storybook": "storybook dev --port 6006",
        "build-storybook": "storybook build"
    },
    "devDependencies": {
        "@nuxt/devtools": "0.8.4",
        "nuxt": "^3.8.1",
        "vue": "^3.3.8",
        "vue-router": "^4.2.5",
        "react": "^18.2.0",
        "react-dom": "^18.2.0",
        "storybook": "7.5.3",
        "tailwindcss": "^3.0.23",
        "@types/node": "^18.17.5",
        "@storybook/vue3": "7.5.3",
        "@storybook/vue3-vite": "7.5.3",
        "@storybook-vue/nuxt": "0.2.0",
        "@storybook/addon-links": "7.5.3",
        "@storybook/builder-vite": "7.5.3",
        "@storybook/addon-essentials": "7.5.3",
        "@storybook/addon-interactions": "7.5.3",
        "@storybook/testing-library": "^0.2.0",
        "@storybook/blocks": "7.5.3"
    },
    "pnpm": {
        "nuxt": "3.8.1"
    }
}