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

Bad character escape sequence on 1.0.0-canary8 and Windows #385

Closed
andrehsu opened this issue Dec 8, 2020 · 4 comments
Closed

Bad character escape sequence on 1.0.0-canary8 and Windows #385

andrehsu opened this issue Dec 8, 2020 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@andrehsu
Copy link
Contributor

andrehsu commented Dec 8, 2020

I encountered the following when running next build

info  - Creating an optimized production build
Failed to compile.
./pages/api/users/[userId]/emails/[emailId].ts:157:31
Syntax error: Bad character escape sequence
  155 |               ...ctx,
  156 | // @ts-ignore
> 157 |               pathname: '/api\users\[userId]\emails\[emailId]'
,
      |                                ^
  158 | // @ts-ignore
  159 |               loaderName: 'getServerSideProps',
  160 | // @ts-ignore

Using next-translate 1.0.0-canary8 on Windows.
This problem came up after migrating to 1.0.0, and reverting the changes fixed it.

@aralroca aralroca added the bug Something isn't working label Dec 8, 2020
@aralroca aralroca added this to the 1.0.0 milestone Dec 8, 2020
@aralroca
Copy link
Owner

aralroca commented Dec 8, 2020

The weird thing is that it should not do anything if the route is pages/api/*, I guess it's for the wrong character... I'll take a look! Thanks to report it! 🙏

@aralroca
Copy link
Owner

aralroca commented Dec 8, 2020

And it is happening with 1.0.0-canary.7? I hope it is not something introduced in the last changes

@andrehsu
Copy link
Contributor Author

andrehsu commented Dec 8, 2020

@aralroca
Oh sorry, it doesn't happen on canary.8, next-translate was declared using ^1.0.0 in package.json, and npm thinks 1.0.0-experimental.20 > 1.0.0-canary.8. Specifying 1.0.0-canary.8 fixes it.

@andrehsu andrehsu closed this as completed Dec 8, 2020
@aralroca
Copy link
Owner

aralroca commented Dec 8, 2020

I'm glad to hear it. In fact, @vimutti77 fixed this in #362

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants