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

Error in rules with prerender: true #13

Closed
shahyar opened this issue Sep 19, 2024 · 1 comment
Closed

Error in rules with prerender: true #13

shahyar opened this issue Sep 19, 2024 · 1 comment

Comments

@shahyar
Copy link

shahyar commented Sep 19, 2024

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.

A temp solution is to run npm run build, edit the dist/cloudflare/_routes.json accordingly, and then npx wrangler pages deploy.

@magne4000
Copy link
Member

Fixed in v0.1.2. All exclude paths now starts with /

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

2 participants