Histoire cannot find stories

187 Views Asked by At

When running $npm run story:dev to start Histoire, I get the following error. I can open the Histoire URl on localhost and see the page without stories, and I can run npm run dev and see the components without errors. Histoire is failing alone.

Stackblitz reproduction of error: https://stackblitz.com/edit/vitejs-vite-cycwey?file=svelte.config.js run $npm run story:dev

Error while collecting story /home/cob/src/lib/Input/Input.story.svelte:
TypeError: Cannot read properties of undefined (reading 'Story')
at create_fragment (/home/cob/src/lib/Input/Input.story.svelte:41:33)
at Module.init (/home/cob/node_modules/svelte/internal/index.mjs:2137:37)
at new Input_story (/home/cob/src/lib/Input/Input.story.svelte:135:25)
at Module.createProxiedComponent (/home/cob/node_modules/svelte-hmr/runtime/svelte-hooks.js:338:9)
at new ProxyComponent (/home/cob/node_modules/svelte-hmr/runtime/proxy.js:243:29)
at new Proxy<Input.story> (/home/cob/node_modules/svelte-hmr/runtime/proxy.js:351:11)
at v (/home/cob/node_modules/@histoire/plugin-svelte/dist/collect/index.js:6:134)
at async run (/home/cob/node_modules/histoire/dist/node/collect/run.js:6:20)
at async default (file:///home/cob/node_modules/histoire/dist/node/collect/worker.js:44:5)
at async file:///home/cob/node_modules/@akryum/tinypool/dist/esm/worker.js:111:20  

My Input.story.svelte

<svelte:options tag="cob-input-hst" />
<script>
    import Input from './Input.svelte';
    export let Hst;
  </script>
  
  <Hst.Story title="Input">
    hello
    <Input {...$$props} // tried with commented out
  </Hst.Story>  

Using a barebones project created with npm create vite@latestand Svelte as template with JS, not TS, and 2 simple components, one of which is the template's own counter (a button that counts +1) that Histoire also fails to find with near identical story to above.

Some versions etc:

├── @histoire/[email protected]
├── @sveltejs/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Some other config missing?

0

There are 0 best solutions below