You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Using the CloudFlare Worker adapter with the latest Kit (1.0.0-next.89) and attempting to publish is causing an Unexpected character '#' error:
wrangler publish
up to date, audited 1 package in 137ms
found 0 vulnerabilities
👀 ./workers-site/index.js 3328:2
Module parse failed: Unexpected character '#' (3328:2)
You may need an appropriate loader to handle this file type.
| }
| var ReadOnlyFormData = class {
> #map;
| constructor(map) {
| this.#map = map;
a workarround untill fixed (or the fix) is to replace the code in node_modules/@sveltejs/adapter-cloudflare-workers/index.js the esbuild part (esbuild.build{....) with:
awaitesbuild.build({entryPoints: ['.svelte/cloudflare-workers/entry.js'],outfile: `${entrypoint}/index.js`,bundle: true,target: 'es2020',platform: 'node'// TODO would be great if we could generate ESM and use type = "javascript"});
(set the target to target: 'es2020') as #map is the translation to a private property and not supported by cloudflare at the moment...
I tested and it worked
Describe the bug
Using the CloudFlare Worker adapter with the latest Kit (
1.0.0-next.89
) and attempting to publish is causing anUnexpected character '#'
error:My
wrangler.toml
:Logs
To Reproduce
Expected behavior
It to deploy to CF worker sites :)
Stacktraces
See top
Information about your SvelteKit Installation:
Diagnostics
npx envinfo --system --npmPackages svelte,@sveltejs/kit,vite --binaries --browsers
:Your browser: Brave (not relevant)
Your adapter: Cloudflare Workers
Severity
Blocking my usage of CF Workers with Kit but I'm just poking around, so not critical, more of an FYI
Additional context
Not that I can think of!
The text was updated successfully, but these errors were encountered: