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
There is an inconsistency in the deployment of Cloudflare worker if project is done without using cloudflare@latest script. If we just add @sveltejs/adapter-cloudflare it can have errors like:
$ npm run deploy
> fairpick@0.0.1 deploy
> wrangler deploy
⛅️ wrangler 3.92.0
-------------------
🌀 Building list of assets...
✘ [ERROR] Uploading a Pages _worker.js file as an asset.
This could expose your private server-side code to the public Internet. Is this intended?
If you do not want to upload this file, either remove it or add an ".assetsignore" file, to the
root of your asset directory, containing "_worker.js" to avoid uploading.
If you do want to upload this file, you can add an empty ".assetsignore" file, to the root of your
asset directory, to hide this error.
The reason for this error is missing the .assetsignore file on .svelte-kit/cloudflare path. The .assetsignore tells that files like _worker.js, _routes.json, _headers, and _redirects are not assets and must not be exposed. See cloudflare/workers-sdk#6640 for details.
Describe the bug
There is an inconsistency in the deployment of Cloudflare worker if project is done without using
cloudflare@latest
script. If we just add@sveltejs/adapter-cloudflare
it can have errors like:The reason for this error is missing the
.assetsignore
file on.svelte-kit/cloudflare
path. The.assetsignore
tells that files like_worker.js
,_routes.json
,_headers
, and_redirects
are not assets and must not be exposed. See cloudflare/workers-sdk#6640 for details.Workaround is adding https://github.com/cloudflare/workers-sdk/blob/main/packages/create-cloudflare/templates-experimental/svelte/js/static/.assetsignore to
static
folder of the project. I am going to issue a PR to fix this.Reproduction
Try to make some UI library based app ((Skeleton, for example) and enable Cloudflare deployment. Follow instructions from:
The deployment script would look like
Error is:
✘ [ERROR] Uploading a Pages _worker.js file as an asset.
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: