vikejs / vike-cloudflare

Cloudflare adapter for Vike
MIT License
3 stars 2 forks source link

Error in rules with `prerender: true` #13

Closed shahyar closed 1 week ago

shahyar commented 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.

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

magne4000 commented 1 week ago

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