No event handlers were registered. This script does nothing. [code: 10021]

So the thing is that i am trying to build full stack application with sveltekit and firebase, when i try to deploy it to workers i was getting node errors from the dependencies of firebase-admin package, so switched my app adapter to @sveltejs/adapter-cloudflare-workers to @sveltejs/adapter-node, now its building with another error
No event handlers were registered. This script does nothing.
[code: 10021]
No event handlers were registered. This script does nothing.
[code: 10021]
, after digging up came to know that building with es6 format would work, but am trying to build to .mjs file format but keep on getting .js file on .svelte-kit/adapter-node folder. How can i fix it, i just want to deploy my svelte fire application to cloudflare. Let me know if am going in right way
4 Replies
Walshy
Walshy8mo ago
Workers aren't nodejs, they need to be a Workers app. You're now building something incompatible with the platform You can try enabling the nodejs_compat compatibility flag and see if the firebase-admin package works. If not, you may need to find an alternative
buckwheat
buckwheatOP8mo ago
wrangler.toml
name = ""
account_id = ""

main = "./.svelte-kit/adapter-node/index.js"
site.bucket = "./.svelte-kit/adapter-node"

build.command = "yarn build"
build.format = "modules"

compatibility_date = "2023-08-14"
node_compat=true
send_metrics = false

[[r2_buckets]]
binding = ''
bucket_name = ''
wrangler.toml
name = ""
account_id = ""

main = "./.svelte-kit/adapter-node/index.js"
site.bucket = "./.svelte-kit/adapter-node"

build.command = "yarn build"
build.format = "modules"

compatibility_date = "2023-08-14"
node_compat=true
send_metrics = false

[[r2_buckets]]
binding = ''
bucket_name = ''
buckwheat
buckwheatOP8mo ago
with @sveltejs/adapter-cloudflare-workers
No description
Walshy
Walshy8mo ago
Yeah you'll need to try and find an alternative package. It isn't supported on Workers.
Want results from more Discord servers?
Add your server