Open MikeAltinget opened 1 year ago
Start a new pull request in StackBlitz Codeflow.
Please give [v0.15.0] a try and report back if your issue is solved or not :pray:
Please give [v0.15.0] a try and report back if your issue is solved or not 🙏
I'm getting a different error with this version:
Error while collecting story /home/projects/github-brmchy/components/Hello.story.vue:
Error: Failed to parse source for import analysis because the content contains invalid JS syntax. Install @vitejs/plugin-vue to handle .vue files.
at formatError (file://file:///home/projects/github-brmchy/node_modules/vite/dist/node/chunks/dep-3007b26d.js:41437:46)
at TransformContext.error (file://file:///home/projects/github-brmchy/node_modules/vite/dist/node/chunks/dep-3007b26d.js:41433:19)
at TransformContext.transform (file://file:///home/projects/github-brmchy/node_modules/vite/dist/node/chunks/dep-3007b26d.js:39676:22)
at async Object.transform (file://file:///home/projects/github-brmchy/node_modules/vite/dist/node/chunks/dep-3007b26d.js:41708:30)
at async loadAndTransform (file://file:///home/projects/github-brmchy/node_modules/vite/dist/node/chunks/dep-3007b26d.js:39514:29)
Minimal reproduction Stackblitz here: https://stackblitz.com/edit/github-brmchy?file=components/Test.story.vue
I have tried installing @vitejs/plugin-vue
as a dependency, dev dependency, with pnpm and with yarn. Nothing seems to work. It's late and I'm probably making a simple mistake, but I can't seem to get it working still.
EDIT:
I had forgotten to include the HstNuxt
plugin in my histoire config. I have also upgraded to version v0.15.7. Seems to work now!
Amazing work, thank you :D Cannot wait to use this at my work
Hmm when I try it in a bigger project, I get this error:
Error while collecting story /Users/mike/code/AltingetFrontendNuxt3/components/Hello.story.vue:
TypeError [ERR_PACKAGE_IMPORT_NOT_DEFINED]: Package import specifier "#app" is not defined in package /Users/mike/.nvm/versions/node/v18.12.1/lib/node_modules/@nuxt/devtools/package.json imported from /Users/mike/.nvm/versions/node/v18.12.1/lib/node_modules/@nuxt/devtools/dist/runtime/plugins/devtools.client.mjs
at new NodeError (node:internal/errors:393:5)
at throwImportNotDefined (node:internal/modules/esm/resolve:347:9)
at packageImportsResolve (node:internal/modules/esm/resolve:748:3)
at moduleResolve (node:internal/modules/esm/resolve:903:16)
at defaultResolve (node:internal/modules/esm/resolve:1124:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36)
I'm working on a reproduction
We also experienced this issue with histoire (v 0.12.4) and useCookie. Upgrading to v 0.15 fixed the issue, but caused some other problems, so we had to find another solution. Switched to an external library for using cookies as a solution.
Describe the bug
When using
useRuntimeConfig()
in a component the following error occurs:Seems related to https://github.com/nuxt/nuxt/issues/14801, but I use auto imports and the newest version of nuxt and histoire
Reproduction
I have made a reproduction here: https://stackblitz.com/edit/github-k8sztc?file=components/HelloRuntimeConfig.vue It consists of a
Hello.story.vue
and aHelloRuntimeConfig.story.vue
story. The only difference is thatHelloRuntimeConfig.story.vue
refers to a component withconst config = useRuntimeConfig()
. If this line is removed, the error disappears.System Info
Used Package Manager
npm
Validations