question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug Report] Breaks when you have extendRoutes defined

See original GitHub issue

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?

<div align="right">This question is available on Nuxt.js community (#c25)</div>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
martinrisseeuwcommented, Jun 27, 2018

@paulgv I have updated the library to 4.0.1 because I wanted to have the custom routes functionality within page components. Unfortunately it looks like that this fix is broken? It seems that extendRoutes in my nuxt.config are ignored. Have you experienced this issue before and have a solution for it? If not I can go back to v2.9.1 and add the routing in the module settings.

1reaction
martinrisseeuwcommented, Mar 27, 2018

@paulgv Great it works. Thanks a lot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug Report] Breaks when you have extendRoutes defined #52
First of all great plugin! I found a bug when you define extendRoutes (https://nuxtjs.org/api/configuration-router/#extendroutes) the Nuxt ...
Read more >
Nuxt Import library to use within extendRoutes - Stack Overflow
I 've added a middleware/extendRouter.ts script, and added this to ... The middleware doesn't have the same issue with importing scripts.
Read more >
Release Notes - Nuxt.js
Nuxt.js now detects when you created a store/ directory and will reload ... Our contributors submitting bug reports, feature requests and commenting on ......
Read more >
BUG REPORT: OSPF Hello Timer on Point-to-Multipoint
It automatically sets the hello-interval to 30 seconds, overruling whatever value is entered for the ip ospf hello-interval. To set the hello-interval back...
Read more >
Hawaii Pedestrian Toolbox
This report was funded in part through a grant from the Federal Highway. Administration, US Department of Transportation. The views and opinions of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found