storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
83.58k stars 9.16k forks source link

[Bug]: decodeEntities option is required in browser builds #25523

Closed p3k closed 5 months ago

p3k commented 6 months ago

Describe the bug

While stories render fine, the following error is thrown in the dev console:

error Error: [@vue/compiler-core] decodeEntities option is required in browser builds.
    at baseParse (compiler-core.esm-bundler.js:2586:1)
    at getComponents (entry-preview-docs.mjs:8:1)
    at getTemplateComponents (entry-preview-docs.mjs:8:1)
    at generateSource (entry-preview-docs.mjs:8:1)
    at immediate (entry-preview-docs.mjs:8:1)
    at callWithErrorHandling (runtime-core.esm-bundler.js:158:1)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:166:1)
    at job (runtime-core.esm-bundler.js:1827:1)
    at doWatch (runtime-core.esm-bundler.js:1858:1)
    at watch (runtime-core.esm-bundler.js:1716:1)#

To Reproduce

not sure I can provide this… :grimacing:

System

Storybook Environment Info:

  System:
    OS: Linux 6.2 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 18.19.0 - /tmp/xfs-38cf59af/node
    Yarn: 4.0.2 - /tmp/xfs-38cf59af/yarn <----- active
    npm: 10.2.3 - /usr/local/bin/npm
  npmPackages:
    @storybook/addon-actions: 7.6.7 => 7.6.7 
    @storybook/addon-essentials: 7.6.7 => 7.6.7 
    @storybook/addon-links: 7.6.7 => 7.6.7 
    @storybook/vue3: 7.6.7 => 7.6.7 
    @storybook/vue3-webpack5: 7.6.7 => 7.6.7 
    eslint-plugin-storybook: 0.6.15 => 0.6.15 
    storybook: 7.6.7 => 7.6.7

Additional context

Might be related to / duplicate of #25496.

Searching for decodeEntities in the Storybook documentation yields no results:

storybook js org_

chakAs3 commented 6 months ago

Please @p3k if you can't reproduce the bug, a PR may introduce another bug that you don't see. so please create a reproduction repo, i will help you fix your issue inshallah.

susnux commented 6 months ago

That error comes from the Vue sfc-compiler, so something wrong with the vue integration of storybook.

I also get this error, but for me the source code of stories is also broken, so this might be related?

Hai-San commented 6 months ago

Same here.

The Source code does not appear here either.

I have the same version in vue2 and it works normally.

Michael2109 commented 5 months ago

@chakAs3 Do you know which version of Vue decodeEntities became required? I'm wondering if a temporary workaround is to downgrade although that could likely lead to other issues.

chakAs3 commented 5 months ago

decodeEntities only used for DOM compilers that runs in the browser. In non-browser builds, this option is ignored. i think it is not about Vue if the browser requires that it will throw downgrading won't solve the issue

JakeHarder commented 5 months ago

I also see this error. I have a few stories, but I only see this error for a component that uses Vue's Date Picker. My package.json has: "vuejs3-datepicker": "^1.1.2" My exact error is:

error Error: [@vue/compiler-core] decodeEntities option is required in browser builds.
    at baseParse (compiler-core.esm-bundler.js:2591:13)
    at getComponents (entry-preview-docs.mjs:8:404)
    at getTemplateComponents (entry-preview-docs.mjs:8:264)
    at generateSource (entry-preview-docs.mjs:8:2799)
    at watch.immediate (entry-preview-docs.mjs:8:2608)
    at callWithErrorHandling (runtime-core.esm-bundler.js:193:18)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:201:17)
    at job (runtime-core.esm-bundler.js:1943:9)
    at doWatch (runtime-core.esm-bundler.js:1981:7)
    at watch (runtime-core.esm-bundler.js:1808:10)

npm ls gives:

├── @storybook/addon-essentials@7.6.11
├── @storybook/addon-interactions@7.6.11
├── @storybook/addon-links@7.6.11
├── @storybook/blocks@7.6.11
├── @storybook/test@7.6.11
├── @storybook/testing-library@0.2.2
├── @storybook/vue3-vite@7.6.11
├── @storybook/vue3@7.6.11
├── @syncfusion/ej2-vue-gantt@24.1.45
├── @syncfusion/ej2-vue-schedule@24.1.41
├── @vitejs/plugin-vue@5.0.3
├── @vue/test-utils@2.4.3
├── ag-grid-community@31.0.1
├── ag-grid-enterprise@31.0.1
├── ag-grid-vue3@31.0.1
├── jest-serializer-vue@3.1.0
├── lodash@4.17.21
├── popper.js@1.16.1
├── react-dom@18.2.0
├── react@18.2.0
├── sass@1.70.0
├── storybook@7.6.11
├── vite@5.0.12
├── vitest@1.2.2
├── vue-template-compiler@2.7.16
├── vue@3.4.15
├── vuedraggable@2.24.3
└── vuejs3-datepicker@1.1.2