Error: Failed to publish assets.

Hi, I'm trying to evaluate Workers&Pages to move my Astro app. The build succeeds, but I get errors like this one:
Error: Failed to publish assets. For support, join our Discord (https://discord.gg/cloudflaredev) or create a ticket and reference the deployment ID: 17e127e9-3242-4017-bf03-2d9923221c19
Error: Failed to publish assets. For support, join our Discord (https://discord.gg/cloudflaredev) or create a ticket and reference the deployment ID: 17e127e9-3242-4017-bf03-2d9923221c19
I tried all configurations, modes, etc., available in the official Astro integration. All reports fail in the deployment step. I saw that this problem was encountered repeatedly, but all were solved in the support tickets, so it would be nice to get some insight if there is a common problem with Astro or configuration or something. Is it related to the newest version, or should I change something?
3 Replies
dosyourself
dosyourselfโ€ข6mo ago
I recently deployed an astro (3.6.6) site with github actions and it worked great. Attached my astro config if it helps.
No description
llamaattheparty
llamaatthepartyโ€ข6mo ago
Thanks @dosyourself.I already migrated my app to astro@4. Due to the fact that I reached the limit of the maximum static routes, I had to change the configuration. So I changed it in the following order: 1) Very basic config:
export default defineConfig({
site: '[my-domain]',
output: "server",
adapter: cloudflare(),
integrations: [
mdx(),
sitemap(),
],
vite: {
ssr: {
noExternal: ['tiny-slider']
}
}
});
export default defineConfig({
site: '[my-domain]',
output: "server",
adapter: cloudflare(),
integrations: [
mdx(),
sitemap(),
],
vite: {
ssr: {
noExternal: ['tiny-slider']
}
}
});
As a result, I got this: Error: Failed to publish your Function. Got error: Error 8000057: Rules in _routes.json are over the 100 rule limit. 2) Then I changed the configuration to the following one:
export default defineConfig({
site: '[my-domain]',
output: "server",
adapter: cloudflare({
mode: 'directory',
imageService: 'cloudflare',
functionPerRoute: true,
routes: {
strategy: "include",
}
}),
integrations: [
mdx(),
sitemap(),
],
vite: {
ssr: {
noExternal: ['tiny-slider']
}
}
});
export default defineConfig({
site: '[my-domain]',
output: "server",
adapter: cloudflare({
mode: 'directory',
imageService: 'cloudflare',
functionPerRoute: true,
routes: {
strategy: "include",
}
}),
integrations: [
mdx(),
sitemap(),
],
vite: {
ssr: {
noExternal: ['tiny-slider']
}
}
});
The log looks this way:
- Deploying your site to Cloudflare's global network...
- Failed: an internal error occurred. If this continues, contact support: https://cfl.re/3WgEyrH
- Error: Failed to publish assets. For support, join our Discord (https://discord.gg/cloudflaredev) or create a ticket and reference the deployment ID: dde54d8a-4025-452a-adbf-3c3e08af934e
- Deploying your site to Cloudflare's global network...
- Failed: an internal error occurred. If this continues, contact support: https://cfl.re/3WgEyrH
- Error: Failed to publish assets. For support, join our Discord (https://discord.gg/cloudflaredev) or create a ticket and reference the deployment ID: dde54d8a-4025-452a-adbf-3c3e08af934e
3..n) Any change in the configuration (imageService, mode, functionPerRoute, routes) finishes with the same error in the log. I figured out what caused the problem. I checked if my build can be deployed by manual (drag & drop) schema. When I clicked a button to deploy uploaded assets. I had an error pointing to a _routes.json file. It should contain at least one rule of include or exclude. It started to operate when I modified the configuration to generate those paths fitting into the max routes limit. I hope it helps someone in the future. Perhaps that error could be covered by a friendly error message in the CLI ๐Ÿ™‚
dosyourself
dosyourselfโ€ข6mo ago