SvelteKit Deployment Not Working
I was able to deploy my SvelteKit Test App fine when I used the Wrangler CLI.
https://cloudflare-svelte.jdgamble555.workers.dev/
https://github.com/jdgamble555/cloudflare-svelte
However, I want to tie my deployments to GitHub Actions instead of using Wrangler. I deployed the exact same app in the dashboard under Pages --> Create Project --> Connect to Git (selecting my project with the SvelteKit Template) and I get the following error:
How can I get this to work through GitHub actions?
J
GitHub
GitHub - jdgamble555/cloudflare-svelte
Contribute to jdgamble555/cloudflare-svelte development by creating an account on GitHub.
9 Replies
#pages-help is probably a better place for this. But it looks like you’re hitting an error due to old Node.js
Try setting your
NODE_VERSION
env bar in the Pages dash to 16
It compiles now, but still does not work... I get a build directory error, so not sure what that should be?
If you setup SvelteKit to do a static pages should be in your
/build
folder.![](https://utfs.io/f/eceecce3-27aa-4077-889b-b9aaa436bb07-5xm1xf.20.26_AM.png)
![](https://utfs.io/f/b737235c-8b59-47ca-9e74-5c25924e5dde-5xm1xf.20.16_AM.png)
![](https://utfs.io/f/06c8c88e-55c6-47da-9e13-7b81ad92b256-5xm1xf.23.24_AM.png)
I don't want to do static pages though, just deploy it through the github connection... does pages not separate the workers?
When you connect pages to your github, it will listen for changes on the branch you've selected. Once a Merge has been pushed to that, the build will run. According to the documentation here: https://developers.cloudflare.com/pages/framework-guides/deploy-a-svelte-site/ the build directory for SK is:
From there, you should see the URL available in CF Pages (Pages > Your Project).
Are you using the SvelteKit Cloudflare Adapter? https://www.npmjs.com/package/@sveltejs/adapter-cloudflare
.svelte-kit/cloudflare
.From there, you should see the URL available in CF Pages (Pages > Your Project).
Are you using the SvelteKit Cloudflare Adapter? https://www.npmjs.com/package/@sveltejs/adapter-cloudflare
Deploy a Svelte site · Cloudflare Pages docs
Svelte is an increasingly popular, open-source framework for building user interfaces and web applications. Unlike most frameworks, Svelte is …
npm
@sveltejs/adapter-cloudflare
Adapter for building SvelteKit applications on Cloudflare Pages with Workers integration.. Latest version: 1.1.0, last published: 4 days ago. Start using @sveltejs/adapter-cloudflare in your p...
![](https://utfs.io/f/eb408e82-477b-46d2-83f2-141cdf8477eb-5xm1xe.40.44_AM.png)
BTW, I'm using NODE_VERSION 17 instead of 16. I hope that helps.
Got it working. Thanks! Turns out I was using
@sveltejs/adapter-cloudflare-workers
instead of @sveltejs/adapter-cloudflare
... thank you sir!