How can I deploy Astro to the railway?
I tried several ways, but I'm more and more confused. There are ways to do this with Vercel, Netfly, but not with Astro and I haven't found any solution yet...
19 Replies
project ID: 0b2301a6-1a20-47a9-8d1c-45cc542ec177
build logs please https://bookmarklets.up.railway.app/log-downloader/
And how do I fix that?
delete your local lock file, run
pnpm install
, push the changesI tried but it didn't work
build logs please
your build has a lot of warnings, please fix them
I'll try
[Region: us-west1]
=========================
Using Detected Dockerfile
=========================
context: 4a8935b17b2aeac58fc2d8cdcf8c4c4c
#0 building with "default" instance using docker driver
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 213B done
#1 DONE 0.0s
#2 [internal] load metadata for docker.io/library/caddy:alphine
#2 ERROR: docker.io/library/caddy:alphine: not found
-----
[internal] load metadata for docker.io/library/caddy:alphine:----- Dockerfile:1 ------------------- 1 | >>> FROM caddy:alphine 2 | 3 | RUN apk update && apk add --no-cache nodejs pnpm ------------------- ERROR: failed to solve: caddy:alphine: docker.io/library/caddy:alphine: not found I tried to make a new project in Astro and now it also gives errors but shows fewer errors
please use the bookmarklet
I'll send it soon
here it is
Yep that can happen if you unintentionally import a module that uses browser api to a server component. Try to keep them as separate modules or at least ensure that a function that accesses document or window object is not called on server side (you can use
typeof window !== 'undefined'
to check for it)I end up not understanding how this works...
Is there an example repository I can look at that is configured for railway up?
your issue isn't with Railway, your issue is with your code, an example alone isn't going to do too much good to help you learn how to build an astro site