Skip to content

Problems when running with /pages directory

Open

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions