Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zeromask1337 opened this issue Oct 17, 2023 · 12 comments
Labels
status: needs reproduction Needs a minimal reproduction type: bug Something isn't working

Comments

@zeromask1337
Copy link

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
Copy link

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
Copy link
Author

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
Copy link

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
Copy link

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
Copy link

gkuga commented Oct 26, 2023

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

nuxt/nuxt#23363

@zeromask1337
Copy link
Author

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
Copy link
Contributor

bmulholland commented Nov 4, 2023

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 or <script> is required in a single file component.
The symbol "_hoisted_1" has already been declared

And so forth

@bmulholland
Copy link
Contributor

See #428 (comment)

@filiphazardous
Copy link

@zeromask1337 This bug may have been fixed by @storybook-vue/nuxt 0.2.0 - could you try updating packages and try it out?

@zeromask1337
Copy link
Author

@filiphazardous unfortunately our team decided to move along with vue, leaving nuxt behind :)

@tobiasdiez
Copy link
Collaborator

Is this still an issue? Could someone please provide a reproduction, preferable based on https://github.com/nuxt-modules/storybook/tree/main/examples/starter.

@tobiasdiez tobiasdiez added type: bug Something isn't working status: needs reproduction Needs a minimal reproduction labels May 2, 2024
@tobiasdiez
Copy link
Collaborator

Closing this issue due to inactivity 💤
Please reopen the issue with additional information if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction Needs a minimal reproduction type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants