Comments (18)
I am facing a similar issue.
When I use NuxtImg
or NuxtLink
in a component in a story, I get the following error on Storybook:
Error: [nuxt] instance unavailable
at useNuxtApp (nuxt.js?v=e83376db:200:13)
at useRouter (router.js?v=e83376db:8:10)
at setup (nuxt-link.js?v=e83376db:146:22)
at callWithErrorHandling (chunk-EGYWHQL7.js?v=e83376db:1877:18)
at setupStatefulComponent (chunk-EGYWHQL7.js?v=e83376db:9273:25)
at setupComponent (chunk-EGYWHQL7.js?v=e83376db:9234:36)
at mountComponent (chunk-EGYWHQL7.js?v=e83376db:7564:7)
at processComponent (chunk-EGYWHQL7.js?v=e83376db:7530:9)
at patch (chunk-EGYWHQL7.js?v=e83376db:6996:11)
at ReactiveEffect.componentUpdateFn [as fn] (chunk-EGYWHQL7.js?v=e83376db:7674:11)
However, this error only happens when I fresh load on the page that I am accessing. If I am on another story and then go to the one containing the NuxtImg
or NuxtLink
, everything works fine.
Dependencies:
"@storybook-vue/nuxt": "0.2.1",
"@storybook/vue3": "7.6.10"
"@storybook/vue3-vite": "7.6.10",
"@storybook/addons": "7.6.10",
"storybook": "7.6.10",
"vite": "5.0.12",
"vue": "3.4.15",
"nuxt": "3.9.3",
"@nuxt/image": "1.3.0",
from storybook-nuxt.
Please share your Storybook repo this is not related to Nuxt i think you're using no serializable prop in you component.
Maybe you are passing a component as prop
from storybook-nuxt.
Please share your Storybook repo this is not related to Nuxt i think you are using no serializable prop in your component.
from storybook-nuxt.
@chakAs3 Check this repo: https://github.com/VegasChickiChicki/nuxt-3-storybook
I have Error: [nuxt] instance unavailable
or Error: Converting circular structure to JSON
if i'm reload page or go between docs and story on navbar storybook
from storybook-nuxt.
On my main project i see this:
I have nuxt context, but with error and my injected plugins...
from storybook-nuxt.
@chakAs3 Hi, can you check this issue. No one injected plugin are not available in the stories
from storybook-nuxt.
Hi @VegasChickiChicki please use the latest version here a working demo
https://stackblitz.com/~/github.com/chakas3/storybook-vuetify-issue
from storybook-nuxt.
Hi @chakAs3 ,
any news on this issue? I still get the Error: [nuxt] instance unavailable
once a story uses the useNuxtApp()
.
Also (I guess it is related) I get an error in the console:
Uncaught (in promise) TypeError: app is not a function
It comes from packages/storybook-nuxt/src/preview.ts:19
from storybook-nuxt.
I get the same issue too but after some jank, it ends up working..
Also btw any nuxt plugin breaks sb
from storybook-nuxt.
Same problem here.
from storybook-nuxt.
Hi guys can you try to use only. @storybook-vue/nuxt now, till get time to look into the module.
@storybook-vue/nuxt is enough to run your Storybook app, The module is more for Nuxt app in order to interact with storybook
from storybook-nuxt.
How would we do that, @chakAs3 ?
I e.g. tried to checkout your example from https://github.com/storybook-vue/storybook-nuxt-starter,
and update the mentioned lib (yarn add --dev @storybook-vue/[email protected]
or yarn add --dev @storybook-vue/[email protected]
), then start storybook and then navigate to http://localhost:6006/?path=/docs/composables-use-config--docs
but I still get the Error: [nuxt] instance unavailable
.
from storybook-nuxt.
Hi @lud-hu can you use pnpm instead i'm still having issue with yarn, i recommend pnpm for now
from storybook-nuxt.
@chakAs3 Unfortunately this does not help as well. :(
Steps to reproduce:
git clone https://github.com/storybook-vue/storybook-nuxt-starter.git
pnpm i
# add useNuxtApp() to components/MyComposable.vue
pnpm storybook
# open http://localhost:6006/?path=/docs/composables-use-config--docs
Errors:
@storybook-vue/nuxt: 0.2.0: Error: [nuxt] instance unavailable
@storybook-vue/nuxt: 0.2.0 & @storybook-vue/[email protected]:
Error: Build failed with 4 errors:
node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@storybook-vue/nuxt/dist/preview.mjs:3:7: ERROR: Could not resolve "#build/paths.mjs"
node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@storybook-vue/nuxt/dist/preview.mjs:4:7: ERROR: Could not resolve "#build/fetch.mjs"
node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@storybook-vue/nuxt/dist/preview.mjs:5:20: ERROR: Could not resolve "#build/plugins"
node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@storybook-vue/nuxt/dist/preview.mjs:6:7: ERROR: Could not resolve "#build/css"
at failureErrorWithLog (/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1649:15)
at /node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1058:25
at /node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1525:9
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
from storybook-nuxt.
Also having this problem, not just with useNuxtApp #97
from storybook-nuxt.
also having this problem.
from storybook-nuxt.
@alniv94 did you try the latest version ?
from storybook-nuxt.
Related Issues (20)
- How to use useAppConfig?
- Configuration with UnoCSS HOT 1
- bug(nuxt-content): could not load file `mdc-imports.mjs` HOT 5
- Windows - ERR_UNSUPPORTED_ESM_URL_SCHEME HOT 9
- __docgenInfo has hardcoded path
- Compatibility issues with Nuxt 3.7.x HOT 7
- Identifier '_createElementVNode' has already been declared after install HOT 5
- Create Human Life Sustainable platform
- Is yarn berry supported? HOT 3
- Using with NuxtIcon: At least one <template> or <script> is required in a single file component HOT 11
- Version 0.2.0 released but not pushed to github? HOT 3
- Unable to start a new storybook nuxt project on windows HOT 1
- missing staticDirs type in `StorybookConfig`
- The auto-import Vue APIs does not work. HOT 1
- Storybook V8 / vue-component-meta support HOT 1
- Warnings and error with vue-router HOT 1
- Versions since 0.2.1 HOT 13
- NuxtLink, useRuntimeConfig, useNuxtApp, anything requiring nuxt instance does not work HOT 9
- feat: Support `@storybook/test` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storybook-nuxt.