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

Encoding custom paths breaks RegExps (introduced in #145) #191

Closed
tronstoner opened this issue Jan 17, 2019 · 1 comment
Closed

Encoding custom paths breaks RegExps (introduced in #145) #191

tronstoner opened this issue Jan 17, 2019 · 1 comment

Comments

@tronstoner
Copy link

Version

v5.3.0

Reproduction link

https://github.com/tronstoner/nuxt-i18n-bugreport

Steps to reproduce

1- git clone https://github.com/tronstoner/nuxt-i18n-bugreport.git
2- npm install
3- npm run dev
4- open console in browser
4- go to http://127.0.0.1:3000
5- Error: [vue-router] missing param for named route "foo-id___de": Expected "id" to match "%5Cd+", but received "666"

What is expected ?

RegExps in custom paths in translations should be left untouched.

What is actually happening?

encodeURI() breaks custom paths. e.g:

"/foo/:slug-:id(\\d+)"
becomes:
"/en/foo/:slug-:id(%5Cd+)"

A change introduced in:
98c9945

Additional comments?

I would be happy if for now encodeURI could be an just option (default: true), so we could simply take care of URI encoding ourselves before pushing paths to the router.

This bug report is available on Nuxt community (#c191)
@ghost ghost added the cmty:bug-report label Jan 17, 2019
@tronstoner
Copy link
Author

Version is actually 5.5.0, don't know why cmty selected 5.3 for me.

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

No branches or pull requests

1 participant