Deployment Failing: "Server is not a constructor"

Hello, I'm trying to deploy a svelte site that has worked fine for the past year or so, but recently I'm unable to deploy at all (old deployments that were succeeding are now failing when retrying) and am getting the following build logs:
16:52:46.548 ✨ Success! Uploaded 41 files (388 already uploaded) (3.08 sec)
16:52:46.548
16:52:47.300 ✨ Upload complete!
16:52:49.736 Uploading to dependency cache
16:52:49.795 Skipping build output cache as it's not supported for your project
16:52:53.613 Success: Dependencies uploaded to build cache.
16:52:55.625 Success: Assets published!
16:52:56.536 Error: Failed to publish your Function. Got error: Uncaught TypeError: Server is not a constructor
at functionsWorker-0.1506027537230603.js:14769:14
16:52:46.548 ✨ Success! Uploaded 41 files (388 already uploaded) (3.08 sec)
16:52:46.548
16:52:47.300 ✨ Upload complete!
16:52:49.736 Uploading to dependency cache
16:52:49.795 Skipping build output cache as it's not supported for your project
16:52:53.613 Success: Dependencies uploaded to build cache.
16:52:55.625 Success: Assets published!
16:52:56.536 Error: Failed to publish your Function. Got error: Uncaught TypeError: Server is not a constructor
at functionsWorker-0.1506027537230603.js:14769:14
Would this have been caused by some update recently? I'm unsure how to proceed. Thank you!
1 Reply
Walshy
Walshy2w ago
GitHub
SvelteKit 2.20.0 introduced `TypeError: Server is not a constructor...
Describe the bug SvelteKit 2.20.0 introduced a TypeError: Server is not a constructor issue at NodeJS server runtime in a certain configuration, where vite-plugin-top-level-await and hooks.server.t...

Did you find this page helpful?