R
Railway8mo ago
conr

Copy of Svelte/Vite Railway Template Fails

Get this error when node build tries to run. Error: Cannot find module '/app/build'
14 Replies
Percy
Percy8mo ago
Project ID: 0a95edc9-3898-4635-87b2-de7a8223688c
Brody
Brody8mo ago
please share your repo and your full build logs https://bookmarklets.up.railway.app/log-downloader/
conr
conr8mo ago
0a95edc9-3898-4635-87b2-de7a8223688c
conr
conr8mo ago
GitHub
GitHub - conrmahr/svelte-kit
Contribute to conrmahr/svelte-kit development by creating an account on GitHub.
conr
conr8mo ago
Project ID: 76337227-d15b-471d-96b7-7d912341682c
Brody
Brody8mo ago
will look into this a bit later
conr
conr8mo ago
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.
Brody
Brody8mo ago
in the mean time review your code for any changes you could have made that would effect this
conr
conr8mo ago
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-variables
SvelteKit docs
Node servers • SvelteKit documentation
Brody
Brody8mo ago
why do you need dotenv on railway? the service variables are automatically injected into the environment
conr
conr8mo ago
I don't know, svelte docs just said use dotenv on production deployments.
Brody
Brody8mo ago
well if it works for you
conr
conr8mo ago
i also had to add a env var so let me try it without it.