Bones
CDCloudflare Developers
•Created by Bones on 1/27/2025 in #general-help
I replaced `adapter-cloudflare-workers` with `adapter-cloudflare`, it works fine, i am going crazy
My questions are:
1. what the hell is going on? 😄
2. am i using cloudflare workers or cloudflare pages right now?
3. on the cloudflare dashboard under
Workers & Pages
i see the worker that i initially created, i know it's a worker because:
- it deploys on urls that look like this https://my-svelte-app.mydomainname.workers.dev/
- after i click on the worker i can see in the "Version History" table -> Source column -> it says "wrangler"
- in the package.json
i can see that the npm run preview
and npm run deploy
commands are clearly using wrangler. Wrangler is supposed to be a CF Workers thing, not a CF pages thing right?
If everything points to me using CF Workers, why is adapter-cloudflare
working just fine?
4. Do CF Pages support SSR?
5. Is it possible to make the Workers Static Assets configuration in the wrangler.json
file to somehow work with adapter-cloudflare-workers
without getting the error mentioned above?
6. and finally, should i use adapter-cloudflare-workers
with adapter-cloudflare
and why?
Thanks for reading my wall, i am new to all this so i might have obvious mistakes in my thinking process 😄3 replies
CDCloudflare Developers
•Created by Bones on 1/27/2025 in #general-help
I replaced `adapter-cloudflare-workers` with `adapter-cloudflare`, it works fine, i am going crazy
But going through the CF Docs i came across the following bit:
naturally, i replaced the following part of my
wrangler.json
:
with this:
as mentioned in the CF Docs. When attempting to run npm run preview
though to test if everything is ok with the worker locally, i got the following error:
I turned to the almighty ChatGPT which suggested replacing adapter-cloudflare-workers
with adapter-cloudflare
in the svelte.config.js
file, i did that:
and to my surprise, it worked! npm run preview
and npm run deploy
ran successfully and everything works in the deployed website.3 replies