histoire icon indicating copy to clipboard operation
histoire copied to clipboard

Failed to use with Element-plus components library

Open pravdinalex opened this issue 8 months ago • 2 comments

Describe the bug

Can't launch Histoire page without errors, when using element-plus visual component library. Tried no setupFile / with setupFile, no auto import components / with auto-import components.

Reproduction

Create empty vue app with npm create vue@latest, add element-plus, add histoire, minimal config element-plus (see src/main.ts: add .css and app.use(ElementPlus)) as described here.

  1. Config Histoire (src/histoire.setup.ts) to use element-plus (same things as in main.ts).

1.1) When Element-plus auto import (in vite.config.ts) is OFF, get this error in browser console:

Image

1.2) When auto import is ON, and explicitly importing component into story (src/components/First.story.vue) get error in shell:

Image

  1. When no setupFile is pointed in histoire.config.ts and no auto-import used, get same error as in 1.1

System Info

Windows 10, node 20.11.1, element-plus 2.9.10, histoire 1.0.0-alpha.2

Used Package Manager

npm

Validations

pravdinalex avatar May 13 '25 16:05 pravdinalex

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'ce')

Image

long36708 avatar May 17 '25 06:05 long36708

using this version, it can work

  "dependencies": {
    "element-plus": "^2.9.10",
    "vue": "^3.5.14",
    "pinia": "^3.0.2"
  },
  "devDependencies": {
    "@histoire/plugin-vue": "^0.17.17",
    "@vitejs/plugin-vue": "^5.2.3",
    "histoire": "^0.17.17",
    "vite": "^5.4.19"
  }

long36708 avatar May 17 '25 06:05 long36708