Weird Pages NextJS build error

Cant really make it what is wrong with it, its quite a simple app, with nothing fancy going on aswell. Error logs are attached
25 Replies
James
James13mo ago
Hello, we don't currently support wasm in next-on-pages, however, it currently has an open PR and you can track the issue at https://github.com/cloudflare/next-on-pages/issues/202 If you aren't the one adding the wasm file, it might be coming from one of your dependencies. Would you be able to try out the prerelease in this PR please? https://github.com/cloudflare/next-on-pages/pull/256
Makisuo
Makisuo13mo ago
I’m not adding any wasm files myself must be a dependency then yes, will try out the prerelease
Makisuo
Makisuo13mo ago
got a diffrent error with the prerelease
James
James13mo ago
That is... interesting. Would it be possible for you to share a (minimal) reproduction?
Makisuo
Makisuo13mo ago
Quite late today I’ll create one tmrw
James
James13mo ago
Thank you, appreciate it Hello, a fix has just been merged that might have resolved this issue for you. Could you please try out the latest beta package? @cloudflare/next-on-pages@beta
Makisuo
Makisuo13mo ago
Sorry I got super busy with work, just tried it again and we definntliy got further! It's succesfully building now though I get this error now
Error: Failed to publish your Function. Got error: multipart: message too large
Error: Failed to publish your Function. Got error: multipart: message too large
James
James13mo ago
I would assume that might mean your zipped worker files are larger than the limit that pages supports (~25mb), you can double check by zipping the .vercel/output/static/_worker.js directory
Makisuo
Makisuo13mo ago
Thanks I'll check Hmmn zipped its 2.4mb for me locally and 12mb unzipped @5927
James
James13mo ago
Are you on the workers free plan?
Makisuo
Makisuo13mo ago
No Im on the Pro Plan
James
James13mo ago
Welp, that's me stumped then :/
Makisuo
Makisuo13mo ago
Hmn unlucky :( I can also deploy a page with wrangler just like a worker right?
James
James13mo ago
Yeah you just use wrangler pages instead
Makisuo
Makisuo13mo ago
Ok I'll try that if it works with the local build Hmn cant seem to get it to work. Whats the best way for me to fix this? Would really love swichting from vercel at some point since I have the rest of my infra already on cloudflare but cant seem to get a working build for months now lol. Havent found a way to contact cloudflare directly other than with business plan right?
James
James13mo ago
I mean, if you're already on workers paid, I don't really see why you would get an error about the payload being too large. Then again, I don't really know much about the different errors, and the _worker.js directory is relatively undocumented. So, I guess a separate help thread or the community forums might attract someone who knows more about what may help you. Sorry, just to clarify, you said you were on pro. Were you referring to cloudflare pro or the workers paid plan?
Makisuo
Makisuo13mo ago
Was referring to workers paid plan, i get confused by cloudflares naming schemes sometimes
James
James13mo ago
Ah fair enough. Yeah, perhaps someone else would know more about the reasons behind that error if you're within the limits. Maybe a separate help thread would be useful
Makisuo
Makisuo13mo ago
Alright I'll try my luck with that then thanks for the help! One more thing even if I get it working would you recommend swapping over from vercel for production sites yet? Feels like things are still a bit rocky
James
James13mo ago
Considering that I'm one of the contributors, I'm confident about using it for production, especially with all the changes and improvements in v1.
Makisuo
Makisuo13mo ago
Yee love what you guys have done over the last few months
James
James13mo ago
I would expect any errors that pop up now to be edge cases that need special attention, like with wasm for instance
Makisuo
Makisuo13mo ago
Alright i'll test drive it then IF i get this weird to work sometime soon hopefully ;) thank you so much for your time
James
James13mo ago
Sure thing, wishing everything turns out okay 🙂