Error deploying SvelteKit after updating Cloudflare libraries

For Workers & Pages, what is the name of the domain?

Still under development

What is the error number?

Build error, not a runtime error

What is the error message?

Could not resolve “../output/server/index.js” from “.svelte-kit/cloudflare/_worker.js”

What is the issue or error you’re encountering

The deployment is failing

What steps have you taken to resolve the issue?

I updated wrangler from 4.20.0 to 4.21.2 and now I’m getting
Could not resolve “../output/server/index.js” from “.svelte-kit/cloudflare/_worker.js”
for my sveltekit application.

Everything was working fine until I tried to add some native node functions. Here is my svelte.config.js adapter

adapter: adapter({
   platformProxy: {
	configPath: 'wrangler.toml',
	environment: 'production',
	persist: true
  },
fallback: 'plaintext'
})

and the relevant values on my wrangler.toml

name = "xxxxxx"
main = ".svelte-kit/cloudflare/_worker.js"
compatibility_date = "2024-12-05"
compatibility_flags = [ "nodejs_compat" ]
observability = { enabled = true }

Again, everything successfully depolyed before I tried to add the node specific functions today.

I’m having the exact same problem, I don’t know what’s wrong, it’s so annoying

I got past that issue, and on to the next head scratcher for the past week. I think updating the svelte.config to this fixed it..

const config = {
	preprocess: [vitePreprocess({})],
	kit: {
		alias: {
			$lib: path.resolve('./src/lib')
		},
		adapter: adapter({
			platformProxy: {
				configPath: 'wrangler.toml',
				environment: 'development',
				persist: true
			},
			fallback: 'plaintext',
			routes: {
				include: ['/*'],
				exclude: ['<all>']
			}
		})
	}
};

I also had to change my vite.config.ts to remove the cloudflare plugin. That fixed the specific issue I was having. This is what the plugins attribute is now:

plugins: [tailwindcss(), sveltekit()],