llamaattheparty
llamaattheparty
CDCloudflare Developers
Created by llamaattheparty on 12/12/2023 in #pages-help
Error: Failed to publish assets.
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 🙂
5 replies
CDCloudflare Developers
Created by llamaattheparty on 12/12/2023 in #pages-help
Error: Failed to publish assets.
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.
5 replies