nuxt-modules / storybook

Storybook integration with Nuxt.
https://storybook.nuxtjs.org
394 stars 89 forks source link

Storybook crashing with `The symbol "_withScopeId" has already been declared` error #449

Closed zeromask1337 closed 1 week ago

zeromask1337 commented 10 months ago

Steps to reproduce

After installing module, generating config and running sb script, storybook crashes with error:

[plugin:vite:vue] Transform failed with 5 errors:
/Users/flippy/Development/black_ore_frontend/pages/registration.vue:98:6: ERROR: The symbol "_withScopeId" has already been declared
/Users/flippy/Development/black_ore_frontend/pages/registration.vue:99:6: ERROR: The symbol "_hoisted_1" has already been declared
/Users/flippy/Development/black_ore_frontend/pages/registration.vue:100:6: ERROR: The symbol "_hoisted_2" has already been declared
/Users/flippy/Development/black_ore_frontend/pages/registration.vue:101:6: ERROR: The symbol "_hoisted_3" has already been declared
/Users/flippy/Development/black_ore_frontend/pages/registration.vue:185:7: ERROR: Multiple exports with the same name "default"

Additional logs:

The symbol "_withScopeId" has already been declared
96 |  import { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, withModifiers as _withModifiers, createTextVNode as _createTextVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue"
97 |  
98 |  const _withScopeId = n => (_pushScopeId("data-v-a0add4b1"),n=n(),_popScopeId(),n)
   |        ^
99 |  const _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("h1", { class: "form-title" }, "Registration", -1 /* HOISTED */))
100|  const _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("p", { class: "cta-question" }, "Already have an account?", -1 /* HOISTED */))

The symbol "_hoisted_1" has already been declared
97 |  
98 |  const _withScopeId = n => (_pushScopeId("data-v-a0add4b1"),n=n(),_popScopeId(),n)
99 |  const _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("h1", { class: "form-title" }, "Registration", -1 /* HOISTED */))
   |        ^
100|  const _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("p", { class: "cta-question" }, "Already have an account?", -1 /* HOISTED */))
101|  const _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("img", {

The symbol "_hoisted_2" has already been declared
98 |  const _withScopeId = n => (_pushScopeId("data-v-a0add4b1"),n=n(),_popScopeId(),n)
99 |  const _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("h1", { class: "form-title" }, "Registration", -1 /* HOISTED */))
100|  const _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("p", { class: "cta-question" }, "Already have an account?", -1 /* HOISTED */))
   |        ^
101|  const _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("img", {
102|    src: "/icons/login-crypto-icons.svg",

The symbol "_hoisted_3" has already been declared
99 |  const _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("h1", { class: "form-title" }, "Registration", -1 /* HOISTED */))
100|  const _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("p", { class: "cta-question" }, "Already have an account?", -1 /* HOISTED */))
101|  const _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode("img", {
   |        ^
102|    src: "/icons/login-crypto-icons.svg",
103|    alt: ""

Multiple exports with the same name "default"
183|  })
184|  import _export_sfc from 'plugin-vue:export-helper'
185|  export default /*#__PURE__*/_export_sfc(_sfc_main, [['render',_sfc_render],['__scopeId',"data-v-a0add4b1"],['__file',"/Users/flippy/Development/black_ore_frontend/pages/registration.vue"]])
   |         ^

What is Expected?

The storybook runs without problem

Version

Nuxt: 3.7.4 @pinia/nuxt: 0.4.11 storybook: 7.5.0-alpha.3

filiphazardous commented 10 months ago

I'm having the same problem. Trying to back out as much as possible, to get a minimal reproduction. Might add that I do not have pinia, but do have tailwind. Also reproduced on storybook 7.4 as well as 7.5

zeromask1337 commented 10 months ago

Someone said it might be related to nuxt version, but I didn't find any official method for version rollback. We only have nuxi upgrade

filiphazardous commented 10 months ago

Interesting! I have started to work on a minimal reproduction, and my findings so far are that the error disappears if I change framework to @storybook/vue3-vite. OTOH, that makes me lose access to nuxt3 composables and aliases. (Which were my biggest reason to use this module.)

filiphazardous commented 10 months ago

I changed nuxt version to 3.6.5 and killed node_modules and the lock-file, to get a clean install. The effect was good, so I'm trying to put everything else (tailwind etc) back in again.

gkuga commented 10 months ago

I think this is the related issue. Its status is pending triage for now.

https://github.com/nuxt/nuxt/issues/23363

zeromask1337 commented 9 months ago

I changed nuxt version to 3.6.5 and killed node_modules and the lock-file, to get a clean install. The effect was good, so I'm trying to put everything else (tailwind etc) back in again.

Just tried your reproduction, didn't work for me (used nuxt storybook) :( Guess I'll have to wait till update

bmulholland commented 9 months ago

Does someone have a working set of packages, even if old? I'm trying to upgrade to Nuxt 3 now, so I've got no working versions except those on Nuxt 2. I've tried setting the version of everything to what's in the playground package.json, but that doesn't work. That's including Nuxt 3.6.5, which most seem to say did work, but doesn't seem to for me. But no matter what I try I get endless errors:

ERROR: Multiple exports with the same name "default" At least one