Skip to content

[Bug Report] Breaks when you have extendRoutes defined  #52

Closed
@martinrisseeuw

Description

First of all great plugin! I found a bug when you define extendRoutes (https://nuxtjs.org/api/configuration-router/#extendroutes) the Nuxt app breaks because of the module. The error it returns in the terminal is as follow:

TypeError: Cannot read property 'replace' of undefined

  - routes.js:42 locales.forEach
    [secrid-nuxt]/[nuxt-i18n]/lib/routes.js:42:40

  - Array.forEach

  - routes.js:39 localizedRoutes.forEach.baseRoute
    [secrid-nuxt]/[nuxt-i18n]/lib/routes.js:39:13

  - Array.forEach

  - routes.js:38 generateRoutes
    [secrid-nuxt]/[nuxt-i18n]/lib/routes.js:38:19

  - module.js:23 Object.extendRoutes
    [secrid-nuxt]/[nuxt-i18n]/lib/module.js:23:23

  - utils.js:119 Object.extendRoutes
    [secrid-nuxt]/[nuxt]/lib/common/utils.js:119:23

  - builder.js:347 Builder.generateRoutesAndFiles
    [secrid-nuxt]/[nuxt]/lib/builder/builder.js:347:50

I created a gist with my Nuxt config: https://gist.github.com/martinrisseeuw/e1ffea12757710c4ff94ef1d95f5cf4b

Do you maybe have a solution or workaround that I can use the module?

This question is available on Nuxt.js community (#c25)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions