Closed shahyar closed 1 week ago
If you build SSG routes with this tool, it will output the following:
✘ [ERROR] Invalid _routes.json file found at: .../dist/cloudflare/_routes.json All rules must start with '/'.
This is because the exclude paths output are as follows:
{ "version": 1, "include": [ "/*" ], "exclude": [ "/assets/*", "index", "404" ] }
Simply changing those to /index and /404 allows Wrangler to successfully upload.
/index
/404
A temp solution is to run npm run build, edit the dist/cloudflare/_routes.json accordingly, and then npx wrangler pages deploy.
npm run build
dist/cloudflare/_routes.json
npx wrangler pages deploy
Fixed in v0.1.2. All exclude paths now starts with /
v0.1.2
/
If you build SSG routes with this tool, it will output the following:
This is because the exclude paths output are as follows:
Simply changing those to
/index
and/404
allows Wrangler to successfully upload.A temp solution is to run
npm run build
, edit thedist/cloudflare/_routes.json
accordingly, and thennpx wrangler pages deploy
.