Copy of Svelte/Vite Railway Template Fails
Get this error when
node build
tries to run.
Error: Cannot find module '/app/build'
14 Replies
Project ID:
0a95edc9-3898-4635-87b2-de7a8223688c
please share your repo and your full build logs https://bookmarklets.up.railway.app/log-downloader/
0a95edc9-3898-4635-87b2-de7a8223688c
GitHub
GitHub - conrmahr/svelte-kit
Contribute to conrmahr/svelte-kit development by creating an account on GitHub.
Project ID: 76337227-d15b-471d-96b7-7d912341682c
will look into this a bit later
I pretty sure it's something simple. I deployed the template and it ran fine, but I added a couple more routes in svelte, but didn't touch the build process and it errors out.
in the mean time review your code for any changes you could have made that would effect this
Ok got it working, but not sure why the template works without
node -r dotenv/config build
.
https://kit.svelte.dev/docs/adapter-node#environment-variablesSvelteKit docs
Node servers • SvelteKit documentation
why do you need dotenv on railway? the service variables are automatically injected into the environment
I don't know, svelte docs just said use dotenv on production deployments.
well if it works for you
i also had to add a env var so let me try it without it.