Deployment fails without any information (Nuxt 3)

Account ID: 1cd594a2551974128ba6e91b0509eef4 Deployment ID (I think?): 1b136818-bb86-4ada-ad89-0e872d8c08e6 Deployment pages dev: https://1b136818.digistudies-marketing.pages.dev I deploy our Nuxt 3 application using wrangler CLI, like so: NITRO_PRESET=cloudflare-pages npm run build && npx wrangler pages deploy dist/ It tells me '✨ Deployment complete! Take a peek over at https://1b136818.digistudies-marketing.pages.dev'. However in the cloudflare dashboard it says 'Deployment failed' (see image) Total size is less than 25MB (13MB~). Amount of files: '2940 Files uploaded' The issue is partially in this piece of code:
if (actualKey.startsWith('element-')) data = (await import(`@/strapi-content/elements/${actualKey}.ts`)).default;
else data = (await import(`@/strapi-content/${actualKey}.ts`)).default;
if (actualKey.startsWith('element-')) data = (await import(`@/strapi-content/elements/${actualKey}.ts`)).default;
else data = (await import(`@/strapi-content/${actualKey}.ts`)).default;
This dynamically imports element information (just some meta info for certain pages). Now the deployment fails since I added 800 more of these files. If if I actually remove the first dynamic import then the build tool will not include those files and then it does deploy without problem. So now the question is why does it fail when I include those 800 extra files? I am not anywhere near the 20k file limit nor am I approaching the total file size limit. If anybody has any ideas or needs some specific information I'm happy to provide it. Thank you!
No description
3 Replies
LemmoTresto
LemmoTresto4mo ago
I forgot to add that this works fine when using wrangler dev with default local mode.
DaniFoldi
DaniFoldi4mo ago
Hi 👋 You should be seeing this error when your deployed worker bundle is too large. On free plan this is 1MB gzipped, on paid this is 10MB. Because of the dynamic import, your bundler is probably including all matches in the final worker bundle, increasing its size above the limit.
LemmoTresto
LemmoTresto4mo ago
That explains a lot thank you! How can I check the final gzipped bundle size? Edit: Figured it out