Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems when running with /pages directory #761

Open
obulat opened this issue Aug 23, 2024 · 1 comment
Open

Problems when running with /pages directory #761

obulat opened this issue Aug 23, 2024 · 1 comment
Labels
type: bug Something isn't working

Comments

@obulat
Copy link
Contributor

obulat commented Aug 23, 2024

When the Nuxt app has a non-empty pages directory, you get the following errors in the console:

vue-router.mjs:35 [Vue Router warn]: No match found for location with path "/iframe.html?id=features-custom-components--custom-template&viewMode=story"
warn @ vue-router.mjs:35
nuxt.js:122 [nuxt] error caught during app initialization Error: Page not found: /iframe.html?id=features-custom-components--custom-template&viewMode=story
    at createError (index.mjs:78:15)
    at router.js:109:29
    at fn (nuxt.js:214:44)
    at Object.runWithContext (runtime-core.esm-bundler.js:2696:18)
    at callWithNuxt (nuxt.js:220:24)
    at nuxt.js:37:41
    at EffectScope.run (reactivity.esm-bundler.js:43:16)
    at Object.runWithContext (nuxt.js:37:31)
    at router.js:109:25
    at vue-router.mjs:3432:52

To reproduce, run example:showcase:dev and go to "http://localhost:6006/?path=/story/features-custom-components--custom-template". You should see this error message displayed twice in the console.

Nuxt only adds the app/router plugin when there are no pages:

https://github.com/nuxt/nuxt/blob/3b907c1c6aa623e88125d731fd267e6a9a89abba/packages/nuxt/src/pages/module.ts#L121-L122

@tobiasdiez
Copy link
Collaborator

@chakAs3 Could you please explain how the custom router setup in the storybook addon works?

In particular, why do we need to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants