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

Replace of 'undefined' in router middleware #164

Closed
toniengelhardt opened this issue Nov 29, 2021 · 2 comments · Fixed by nuxt/framework#2319
Closed

Replace of 'undefined' in router middleware #164

toniengelhardt opened this issue Nov 29, 2021 · 2 comments · Fixed by nuxt/framework#2319

Comments

@toniengelhardt
Copy link

toniengelhardt commented Nov 29, 2021

Environment



Reproduction

Add the following to nuxt.config.js:

router: {
    base: '/',
    middleware: ['auth'],
    linkActiveClass: 'active',
    linkExactActiveClass: 'exact-active',
    extendRoutes(routes) {
      routes.push({
        path: '/',
        redirect: '/write',
      })
    }
  },

The important part that fails is middleware: ['auth'] as specified in the @nuxtjs/auth-next module docs as well as in the Nuxt docs.

Try to start the dev server.

Describe the bug

When running yarn dev the following error appears:

image

This is bc in node_modules/@nuxt/bridge/dist/chunks/module2.mjs:

image

at map((m) => ...) where m is simply the string "auth" and therefore m.src is undefined.

I raised this error already in the @nuxt/auth repo here, but they think it is a Nuxt Bridge problem and I agree, bc it shows up when following the Nuxt docs.

@danielroe danielroe added bug Something isn't working and removed pending triage labels Dec 6, 2021
@danielroe danielroe self-assigned this Dec 6, 2021
@danielroe danielroe added needs reproduction pending triage and removed bug Something isn't working labels Dec 6, 2021
@danielroe
Copy link
Member

Would you provide a minimal reproduction?

@toniengelhardt
Copy link
Author

Hey @danielroe, thanks for taking a look!

Here is the reproduction:

Github: https://github.com/toniengelhardt/nuxt-bridge-debug
CodeSandBox: https://codesandbox.io/s/cool-benji-c0ryp

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

Successfully merging a pull request may close this issue.

2 participants