🐛 BUG: wrangler2 can not decode `[` and `]`
See original GitHub issueWhat version of Wrangler
are you using?
2.0.16
What operating system are you using?
Mac
Describe the Bug
Description
When I serve my next app statically with wrangler pages dev out
, I believe wrangler is failing to decode [id]
and throwing me a 404 error. When I examine the network tab of the developer console, I see that the failing request is to %5Bid%5D
. However the same request results with a 200 response on Cloudflare Pages. Also if I edit the failing GET request by replacing the %5B
and %5D
with [
and ]
, I get a 200 response. I believe there is something wrong with the decoding of [
and ]
.
Steps to Reproduce
- Create a next app with
yarn create next app pages-example
- Add
"export": "next export"
to package.json - create a directory under
/pages
named p and create an empty[id].js
file. - fill the file with the following content
import React from 'react'; import { useRouter } from 'next/router'; const Page = () => { const router = useRouter(); const { id } = router.query; console.log(id, router); return ( <div> id from url: { id } </div> ); }; export default Page;
- create a
/functions/p/[id].js
with the following contentexport function onRequestGet({ env, request, params }) { console.log("entering the function") console.log("env", env) console.log("request", request) return env.ASSETS.fetch(new Request(new URL('/p/[id]', request.url).toString(), request)); }
- run
yarn build && yarn export
- run
wrangler pages dev out
- type
http://localhost:8788/p/12
to the address bar.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:18 (6 by maintainers)
Top Results From Across the Web
BUG: Route of `*/*` can no longer be deployed with Wrangler ...
Mac and Linux Describe the Bug We have been using the pattern of: route = { pattern = "*/*", zone_name = "decode.do" }...
Read more >Wrangler commands - Cloudflare Workers docs
Wrangler commands. Wrangler offers a number of commands to manage your Cloudflare Workers. docs - Open this page in your default browser.
Read more >Cask Data Application Platform 发行说明
This release introduces a number of new features, improvements, and bug fixes to CDAP. Some of the main highlights of the release are:...
Read more >Rita Kozlov - Noise
Not only is SQLite the most ubiquitous database in the world, used by billions ... and where there's code, well, bugs are also...
Read more >homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter
aacgain 1.8 AAC‑supporting version of mp3gain
aalib 1.4rc5 Portable ASCII art graphics library
aamath 0.3 Renders mathematical expressions as ASCII art
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll have a look into resolving that in the morning 🙂
@Skye-31 I can test it tomorrow and let you know!