Nuxt.js: Dynamic Route always required

Created on 19 Aug 2020  路  6Comments  路  Source: nuxt/nuxt.js

Versions

  • nuxt: 2.12.2
  • node: v10

Reproduction

these are my routes and _buscando is a dynamic one. The problem is that I need to be no-required and nuxt is creating it required.
Captura de Pantalla 2020-08-19 a la(s) 12 33 04

What is Expected?

I expect this result
Captura de Pantalla 2020-08-19 a la(s) 12 35 14

What is actually happening?

This is what is happening
Captura de Pantalla 2020-08-19 a la(s) 12 35 02

Note:
is the optional path only posible inside a directory?
Captura de Pantalla 2020-08-19 a la(s) 12 42 16

https://nuxtjs.org/guides/features/file-system-routing#dynamic-routes

bug-report

All 6 comments

Try again by upgrading nuxt to latest version, 2.14.3.

@farnabaz Hi!, I updated my nuxt version to 2.14.3 but now I have errors when I make npm run dev
Captura de Pantalla 2020-08-24 a la(s) 17 46 18
I don't understand why the error is about status code 401...I'm using axios ^5.3.6, do I need to update this too?

This might solve by removing node_modules in installing dependencies again.
Do you have any HTTP call inside nuxt config?

Yes, I have HTTP calls inside my nuxt config...
Captura de Pantalla 2020-08-25 a la(s) 10 15 24
The last three modules make HTTP calls and the last two are for page dynamic generating.

I removed node_modules and install again but the error persist.

@farnabaz for some kind of reason I have troubles width one global variable in mine .env
My .env variable es kind of $3y$104$tNJmuXZKGwi0l38A.other-stuff, but then inside my HTTP call modules the value is undefinedundefined.other-stuff. I made some test and realise the special character $ is the problematic one.
I don't know if this problem is my error or because the new nuxt version that I just updated
Captura de Pantalla 2020-08-25 a la(s) 11 25 36
(inside HTTP Call module => commerceData.js)
Captura de Pantalla 2020-08-25 a la(s) 11 26 16

When I make console.log(process.env) inside nuxt.config.js the result is the same for that variable undefinedundefined.other-stuff

@felubra updating to nuxt 2.14.3 works. Now the dynamic route is not required like I described in this bug but what is happening with globals variables from .env must be solved. I'll create a new bug report for that. I'll close this bug report. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vadimsg picture vadimsg  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments

jaredreich picture jaredreich  路  3Comments

nassimbenkirane picture nassimbenkirane  路  3Comments

lazycrazy picture lazycrazy  路  3Comments