feat: Cloudflare Vite plugin integration#15627
feat: Cloudflare Vite plugin integration#15627teemingc wants to merge 78 commits intofetchable-dev-environmentfrom
Conversation
This reverts commit eaffa39.
|
|
Got the same issue as @zhihengGet as well as @ivo22dev. Had to patch adapter cloudflare like so and my vite config now looks like |
|
In the latest version, I've changed it to use |
|
i tried @raymonddaikon approach still cant run on dev, tried latest pr.new but getting ' for build i got this issue on windows |
Thanks this is useful info. I’ll need to check the Kit code too to properly posixify or not where necessary. Meanwhile the server code optimisation will be fixed once we merge the vite-plugin-svelte PR. However, that’s also blocked on a Windows bug I’m failing to reproduce currently. I’m away from home until May 10th but I’ll have Windows access after that |
Co-authored-by: Copilot <copilot@github.com>
What node version are you running? Also you may need to add an override to your package.json since the adapter-cloudflare package doesn't resolve to the pr.new bulid of sveltekit. I managed to get the dev server running on the latest pr.pkg but still applying my patch and workaround vite plugins. |
|
btw @teemingc i think it might be a good idea to remove below, it threw me off because if i use the same URL as cache key, it will skip calling my api. i wanted to return cache under certain checks then return it. due to below, i need to use a different cache key worker cache said caching happens after worker. user can start caching in their code and we can remove worktop/cfw.cache. |
|
so i tried on wsl ubuntu with node 22, got the same error when doing build with and without extra patches ray mentioned idk what is wrong, maybe i have circular deps or something weird which caued this, but it works without this new adapter on windows. |
I'd recommend creating a new issue to discuss this as this behaviour has existed before this PR. |
|
This message was written with the help of Cursor, so I would like to apologize on my behalf for not catching obvious mistakes and or idiocy said. It's the first time I'm trying to use pkg.pr.new, and I'm not familiar with it, so I'm not so sure everything I've done makes sense. Plus, I'm definitely not expert in implementation of the adapter system of SvelteKit, but I really enjoy deploying my apps on Cloudflare, and these fixes would help A LOT all my projects as I (think I) extensively use the Vite Environment API via wrangler/vite dev to bind multiple local cloudflare services via Cloudflare Env (or in this case SvelteKit's platform.env). That said, I think I've found the same bug as above, but on macOS, and I do not understand if I'm making obvious mistakes in using new tech I'm not too aware of, or if there are bugs. Start of the AI aided message I am testing the Cloudflare Vite plugin integration branch: Relevant
|
|
In response to my previous message, by cloning this PR branch, a fix was the following (again, not entirely sure is the correct long term fix, but it fixes the symptoms): Adapter:
|
|
Thanks @Giggiux let me try to add a test for this and also tighten up that importer check |
closes #10496
closes #13692
closes #1712
closes #2963
closes #13300
closes #1519
wip
This PR also removes support for Cloudflare Pages.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits