Pages: Failed to publish your Function.

Hi all, just getting this error when trying to deploy an astro ssr (with the cloudflare integration):
Error: Failed to publish your Function. Got error: Uncaught Error: No such module "chunks/prerender_BU2rOQkH.mjs". imported from "renderers.mjs"
I'm not going to lie, I have very little idea where to start or what it's actually complaining about. Would appreciate some advice! *edit: The log in case it helps:
05:44:36.224 ✨ Compiled Worker successfully 05:44:36.272 Found _routes.json in output directory. Uploading. 05:44:36.291 Validating asset output directory 05:44:37.259 Deploying your site to Cloudflare's global network... 05:44:40.757 Uploading... (44/44) 05:44:40.758 ✨ Success! Uploaded 0 files (44 already uploaded) (0.34 sec) 05:44:40.758
05:44:41.187 ✨ Upload complete! 05:44:44.175 Success: Assets published! 05:44:45.813 Error: Failed to publish your Function. Got error: Uncaught Error: No such module "chunks/prerender_BU2rOQkH.mjs". imported from "renderers.mjs"
7 Replies
toon159
toon1597mo ago
same issue 🥹 I somehow fixed the issue by adding client:only="react" to my React components. Downgrading @astrojs/cloudflare to 9.2.1 works for me.
Nick
NickOP7mo ago
haha, yeah, discovered this yesterday too 😄 Thanks for getting back to me though!
toon159
toon1597mo ago
All good 😄 @astrojs/cloudflare v10.2.6 now fixed this issue. I updated just now.
Nick
NickOP7mo ago
Nice, thanks a lot for the update 🙂
raven
raven6mo ago
I'm having the same issue as well but even after updating to the latest package 2024-05-31T10:24:28.939755Z + @astrojs/cloudflare 10.2.6 and getting 20:25:15.044 Error: Failed to publish your Function. Got error: Unknown internal error occurred. not much to go off 🙂 Any tips?
raven
raven6mo ago
hmm some more info, I came across this thread (https://github.com/withastro/astro/issues/6516) and I am at the 100 item cap for includes+excludes. My astro config looks like this:
{
output: "server",
adapter: cloudflare({
routes: {
exclude: ["/post/*"],
},
}),
integrations: [mdx(), tailwind()],
}
{
output: "server",
adapter: cloudflare({
routes: {
exclude: ["/post/*"],
},
}),
integrations: [mdx(), tailwind()],
}
GitHub
Very large exclude attribute on _routes.json file, crashing de...
What version of astro are you using? 2.1.2 Are you using an SSR adapter? If so, which one? Cloudflare @6.2.0 What package manager are you using? npm What operating system are you using? Linux What ...
raven
raven6mo ago
Downgrading to 9.2.1 worked - heppy to help in anyway I can to resolve this with the latest version!
Want results from more Discord servers?
Add your server