Error only during build: _sfc_main is not defined #302
-
|
Hi, I just picked up Histoire and so far the experience has been a lot smoother than Storybook. I started out simple with only one story and running Error while collecting story /Users/finanzritter/Code/frontend/hermelin-extras/src/contract/HermelinContract.story.vue:
ReferenceError: _sfc_main is not defined
at /Users/finanzritter/Code/frontend/hermelin-extras/src/contract/HermelinContract.vue:117:1
at async ViteNodeRunner.directRequest (file:///Users/finanzritter/Code/frontend/hermelin-extras/node_modules/vite-node/dist/client.mjs:217:5)
at async ViteNodeRunner.cachedRequest (file:///Users/finanzritter/Code/frontend/hermelin-extras/node_modules/vite-node/dist/client.mjs:113:12)
at async request (file:///Users/finanzritter/Code/frontend/hermelin-extras/node_modules/vite-node/dist/client.mjs:136:16)
at async /Users/finanzritter/Code/frontend/hermelin-extras/src/contract/HermelinContract.story.vue:6:31
at async ViteNodeRunner.directRequest (file:///Users/finanzritter/Code/frontend/hermelin-extras/node_modules/vite-node/dist/client.mjs:217:5)
at async ViteNodeRunner.cachedRequest (file:///Users/finanzritter/Code/frontend/hermelin-extras/node_modules/vite-node/dist/client.mjs:113:12)
at async request (file:///Users/finanzritter/Code/frontend/hermelin-extras/node_modules/vite-node/dist/client.mjs:136:16)
at async run (/Users/finanzritter/Code/frontend/hermelin-extras/node_modules/@histoire/plugin-vue2/dist/bundled/client/server/run.js:8:29)
at async run (/Users/finanzritter/Code/frontend/hermelin-extras/node_modules/histoire/dist/node/collect/run.js:6:20)
node:internal/process/promises:265
triggerUncaughtException(err, true /* fromPromise */);
^ |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Do you have a runnable repro please? 🙏 |
Beta Was this translation helpful? Give feedback.
-
|
Turns out, I had two problems that caused this:
I can now build as expected! |
Beta Was this translation helpful? Give feedback.

Turns out, I had two problems that caused this:
vite-plugin-vue2. So I upgraded to Vue 2.7 and switched to using the new plugin@vitejs/plugin-vue2.compilerOptions.targetset to'es2019'in my tsconfig. Setting it to'esnext'helped solve the issue.I can now build as expected!