#SvelteKit Deployment Not Working

10 messages · Page 1 of 1 (latest)

mystic rune
#

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:

16:28:07.802    (node:1279) ExperimentalWarning: The ESM module loader is experimental.
16:28:07.810    file:///opt/buildhome/repo/node_modules/@sveltejs/kit/postinstall.js:8
16:28:07.810        const cwd = process.env.INIT_CWD ?? process.cwd();
16:28:07.810                                          ^
16:28:07.810    
16:28:07.810    SyntaxError: Unexpected token '?'
16:28:07.811        at Loader.moduleStrategy (internal/modules/esm/translators.js:81:18)
16:28:07.811        at async link (internal/modules/esm/module_job.js:37:21)

How can I get this to work through GitHub actions?

J

GitHub

Contribute to jdgamble555/cloudflare-svelte development by creating an account on GitHub.

turbid socket
#

#1063191651796914276 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

mystic rune
runic hare
mystic rune
runic hare
# mystic rune I don't want to do static pages though, just deploy it through the github connec...

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: .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

Svelte is an increasingly popular, open-source framework for building user interfaces and web applications. Unlike most frameworks, Svelte is …

#

BTW, I'm using NODE_VERSION 17 instead of 16. I hope that helps.