Replies: 1 comment
|
This is exactly what's happening, and yes it belongs here since it affects the With Cloudflare Pages recently added infinite loop detection to their redirect processing. Since Cloudflare strips The cleaner fix doesn't need a redirect rule at all, Cloudflare Pages natively supports a export default defineConfig({
hooks: {
async compiled(nitro) {
const { readFile, writeFile, copyFile } = await import("node:fs/promises");
const { join } = await import("node:path");
const outDir = nitro.options.output.publicDir;
const indexPath = join(outDir, "index.html");
await copyFile(indexPath, join(outDir, "200.html"));
const redirectsPath = join(outDir, "_redirects");
const contents = await readFile(redirectsPath, "utf-8");
const cleaned = contents
.split("\n")
.filter((line) => !line.startsWith("/* /index.html"))
.join("\n");
await writeFile(redirectsPath, cleaned);
},
},
});Since this is a preset level problem rather than something specific to any one project's config, it'd be worth having the |
Uh oh!
There was an error while loading. Please reload this page.
I have described the issue in nuxthub repo, but this is caused by recent change in cloudflare pages and will affect all nitro deploys to cloudflare pages:
nuxt-hub/core#902
Maybe it should be addressed here
All reactions