_routes.json not being honoured

As explained in title, my deployment is successful in the sense that the _worker.js file is uploaded along with all my static assets. But, for some reason, the rules defined in _routes.json file is not being honoured. This is what my _routes.json file looks like:
{
"version": 1,
"include": [
"/*"
],
"exclude": [
"/favicon.ico",
"/assets/*",
"/fonts/*",
"/images/*",
"/icons/*",
"/shiki/*",
"/scripts/*",
]
}
{
"version": 1,
"include": [
"/*"
],
"exclude": [
"/favicon.ico",
"/assets/*",
"/fonts/*",
"/images/*",
"/icons/*",
"/shiki/*",
"/scripts/*",
]
}
Accessing the 404 image file, for example, should load the image: https://4a687e1b.gitreach.pages.dev/images/404.jpeg But it doesn't. Instead the catch-all function is called. Seems to be similar to this issue: https://community.cloudflare.com/t/assets-in-cloudflare-pages-are-not-compiled-correctly/475027/5 Please help! Thanks! Account ID: f85ab44be17b883bc4f119b3af7ac14f Deployment ID: 4a687e1b-5d65-4954-b2f8-c8502edad628
No description
1 Reply
shripad_krishna
shripad_krishna3mo ago
Okay this is my bad. My JSON was malformed (extra comma in the "exclude" array). I really think Cloudflare should throw an ERROR explaining that the _routes.json file is malformed instead of just silently failing to upload the _routes.json file.