How can I deploy Astro to the railway?
joseth
HOBBYOP

2 years ago

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…

21 Replies

joseth
HOBBYOP

2 years ago

project ID: 0b2301a6-1a20-47a9-8d1c-45cc542ec177


2 years ago

build logs please


joseth
HOBBYOP

2 years ago

this?


2 years ago

Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with package.json

joseth
HOBBYOP

2 years ago

And how do I fix that?


2 years ago

delete your local lock file, run pnpm install, push the changes


joseth
HOBBYOP

2 years ago

I tried but it didn't work


joseth
HOBBYOP

2 years ago


2 years ago

build logs please


joseth
HOBBYOP

2 years ago


2 years ago

your build has a lot of warnings, please fix them


joseth
HOBBYOP

2 years ago

I'll try


joseth
HOBBYOP

2 years ago

[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


joseth
HOBBYOP

2 years ago

I tried to make a new project in Astro and now it also gives errors but shows fewer errors


2 years ago

please use the bookmarklet


joseth
HOBBYOP

2 years ago

I'll send it soon


joseth
HOBBYOP

2 years ago

here it is


2 years ago

document is not defined

Hint: Browser APIs are not available on the server.

If the code is in a framework component, try to access these objects after rendering using lifecycle methods or use a `client:only` directive to make the component exclusively run on the client.

See https://docs.astro.build/en/guides/troubleshooting/#document-or-window-is-not-defined for more information.

maddsua
HOBBY

2 years ago

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)


joseth
HOBBYOP

2 years ago

I end up not understanding how this works…
Is there an example repository I can look at that is configured for railway up?


2 years ago

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


Loading...