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.

dynamic routes url in dev mode contains illegal characters

See original GitHub issue

Environment

  • Operating System: Linux
  • Node Version: v16.16.0
  • Nuxt Version: 3.0.0-rc.11
  • Nitro Version: 0.5.4
  • Package Manager: npm@8.11.0
  • Builder: vite
  • User Config: modules, colorMode, ssr, app, store, srcDir, vite
  • Runtime Modules: @pinia/nuxt@0.4.2, @nuxtjs/tailwindcss@5.3.3, @nuxtjs/color-mode@3.1.6
  • Build Modules: -

Reproduction

same issue as in #1494

java.net.URISyntaxException: Illegal character in path at index 22: http://localhost:8080/[...slug]-4eea24f4.mjs at java.base/java.net.URI$Parser.fail(Unknown Source) at java.base/java.net.URI$Parser.checkChars(Unknown Source) at java.base/java.net.URI$Parser.parseHierarchical(Unknown Source) at java.base/java.net.URI$Parser.parse(Unknown Source) at java.base/java.net.URI.<init>(Unknown Source) at java.base/java.net.URI.create(Unknown Source) at reactor.netty.http.HttpOperations.resolvePath(HttpOperations.java:388) at reactor.netty.http.server.HttpServerOperations.<init>(HttpServerOperations.java:160) at reactor.netty.http.server.HttpServerOperations.<init>(HttpServerOperations.java:136)

Describe the bug

If a dynamic route is used, production build urls are sanitized. During development this sanitation is not applied leading to Illegal characters (rfc2396).

Additionally if we take a dynamic route e.g. details-[id].vue during development this will create illegal urls. If we instead use details-:id.vue it works, but I’m not sure if this should be escaped before passed to vue router or not.

Additional context

#1494

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sapphi-redcommented, Oct 4, 2022

Thanks for the replies. 💚

I think it’s better to handle in Vite (or by a plugin). (or the Java server)

And I think it’s more a feature request than a bug in vite or nuxt (since it’s compliant to URL standard spec).

1reaction
JoHaHucommented, Sep 29, 2022

Ok. Then i will close this here and reopen in vite.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nuxtjs spa dynamic routes generate 404 after prod deployment
When running in dev mode all urls work corretly, after npm run build and deployment to a weblogic server I can only access...
Read more >
Routing | Craft CMS Documentation | 3.x
Routing helps Craft smartly handle requests to your site. When a request comes in to Craft, it checks to determine where to route...
Read more >
"Illegal character in path" while using Dynamic URL in Rest V2 ...
The issue occurs because while editing the swagger file, the dynamic field that needs to be added. Example. 'id' according to the error...
Read more >
Routes · Cloudflare Workers docs
Cloudflare Site routes are comprised of: Route URL (refer to Matching Behavior); Worker script to execute on matching requests; Failure mode for ...
Read more >
Rewrites - next.config.js
Note: rewrites in beforeFiles do not check the filesystem/dynamic routes immediately after matching a source, they continue until all beforeFiles have been ...
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