Can you give me a minimal reproduction? Is it possible you had the env variable on the server but not on dev or the opposite? There's something we could do to help future devs to catch this error easily?
Comments
Log in with your Bluesky account to leave a comment
It was on kit 1.30 and adapter-node 1.3.1, so rather an old version. While running the app in development mode, although node adapter is configured instead of auto, there is no such file size check in place, no error message was shown. Only saw the error after build and preview.
The issue popped up on the prod environment after deployment - we did not have any "direct" file upload handling thorugh sveltekit backend, so this was something new.
As the response returned on the site with 413, I suspected nginx as that is the main difference from local development.
I don't really think it's on sveltekit or adapter-node, this troubleshooting was on me and my inexperience with the adapter settings. Sure vite dev mode could emulate directly the node adapter when configured and throw errors even in dev, but I'm sure there is a reason it works the way it is.
I'm porting soon this app to newer version of sveltekit, will keep an eye out if such dev-prod inconsistency is in place and make a repro / issue then if it's still the case.
Oh yeah this is an issue we are well aware of (the fact that adapters don't run in dev)...I think the new environment API of vite 6 should help solve this kind of issues...thanks for the explanation
Comments
As the response returned on the site with 413, I suspected nginx as that is the main difference from local development.