2 months ago
Having a bizzare issue of my deployed sveltekit app no longer serving the javascript for the site (standard js for opening dropdowns and stuff). The page loads fine, but indefinitely loads a hanging resource which never loads and then crashes the site.
The page has no error requests, and loads images that don't exist as 200 despite not content. No errors on railway logs.
Attempted to roll back to working branches, with the same issue persisting. Tried to delete and completely instantiate new instance but has the same issues.
Tried deploying on other services (digital ocean) and everything worked as expected.
0 Replies
Just had a hiccup of the javascript loading momentarily, but the static images did not load. I made an update to remove static image (use hosted elsewhere) and now the js is broken again.
When the JS was loading properly, was working on vivaldi but not chrome. On both i used incognito tabs with storage wiped.
Very bizzare, tricky to debug
heres a video demonstrating the issue of components that need javascript (days until counter in top left uses new Date, and the dropdown a simple state boolean)
also shows no failing requests or error logs, which makes it very challenging to debug.
And to reiterate, this problem did not occur on fresh install to digital ocean. And reverting to a working backup maintained the same problems. Including when making a brand new railway instance
(i work with jolly on this)
we had to migrate to digital ocean for now until this is fixed 😦
really would appreciate to be back on railway
2 months ago
Hello!
Can I see a link to this site that is hosted on Railway please?
you'll the top left counter is "0" days and hamburger menu doesn't work on the top right
same branch/commit on https://oniondao.dev < hosted on digital ocean (DNS is still updating so you might get redirection to railway in some cases)
2 months ago
deployed with the same dockerfile?
2 months ago
on Railway you have a custom start command, are you also using that start command on DO?
one thing i thougth the error might be was we were initially on metal servers, switched to non metal servers, but still error persisted
2 months ago
when i load the Railway hosted site im seeing 3 requests for JS files that are stuck pending
2 months ago
well since removing the start command you are now running a dev server
2 months ago
i dont think thats the direction we want to go in
ideally would use build + start command, but just trying to get it working
2 months ago
The dockerfile uses bun, any change you are down to switch to that to Node?
2 months ago
yes please
2 months ago
i also put the start command back for you, it will be used on the next deploy you do
switching to nixpacks as builder instead of dockerfile should auto use node right?
2 months ago
i cannot recommend nixpacks, but i can recommend Railpack
2 months ago
you would need to delete or rename the Dockerfile to switch to either nixpacks or railpack
2 months ago
but probably dont wanna do that since you said you have DO hooked up to the same repo?
2 months ago
fair enough
like i really would prefer to get railway working, much prefer you guys to DO
2 months ago
want to temporarily remove your bun lock file so that node and only node is used?
whats the best way to pass in a flag for npm install step in Railpack?
2 months ago
probably with RAILPACK_INSTALL_CMD
https://railpack.com/config/file found it
2 months ago
its a service variable, but if you prefer putting it in a config file you could do railpack.json
2 months ago
{
"$schema": "https://schema.railpack.com",
"steps": {
"install": {
"commands": ["npm install --legacy-peer-deps"]
}
}
}
2 months ago
what did you end up putting in the railpack.json?
{
"$schema": "https://schema.railpack.com",
"steps": {
"install": {
"commands": ["npm install --legacy-peer-deps"]
},
"build": {
"commands": ["npm run build"]
},
"start": {
"commands": ["node build/index.js"]
}
},
"provider": "railway"
}
2 months ago
interesting approach, just use what i provided haha
2 months ago
one sec
2 months ago
ill have to raise this issue with railpack, but for now did you want to move back to a Dockerfile? -
FROM node:22-slim
ENV NPM_CONFIG_UPDATE_NOTIFIER=false
ENV NPM_CONFIG_FUND=false
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --legacy-peer-deps
COPY . ./
RUN npm run build
ENTRYPOINT ["node", "build/index.js"]
2 months ago
updated the Dockerfile
2 months ago
how was bun coping with the dep conflict?
2 months ago
well you still need it haha
2 months ago
no, its a hidden error, you are missing a package-lock.json file
2 months ago
i've updated Dockerfile
2 months ago
okay the 3d onion is bouncing
2 months ago
we need to do one more test to rule that out
2 months ago
can you give me your original dockerfile?
FROM oven/bun:latest
COPY . /app
WORKDIR /app
RUN bun install
RUN bun run build
EXPOSE 4173
CMD ["bun", "run", "preview", "--host"]
this is the editted one i was trying
2 months ago
that one is fine, i have a theory, when you where using that bun Dockerfile, you still had the railway start command set to use node, thus you built with bun, but never ran with bun, I'm going to modify that dockerfile to also run with bun
i think this was the one before i started editting:
FROM oven/bun:1.2
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json ./
# Copy the original package.json back
COPY package.json ./
# Install all dependencies
RUN bun install --no-production
# Copy application code
COPY . .
# Build the application
RUN bun run build
# Expose the port
EXPOSE 3000
ENV PORT=3000
ENV HOST=0.0.0.0
# Start the application
CMD ["node", "build/index.js"]
2 months ago
bring your bun lockfile back and try this simple dockerfile -
FROM oven/bun:latest
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install
COPY . ./
RUN bun run build
CMD ["bun", "build/index.js"]
2 months ago
"/bun.lockb": not found
2 months ago
ah text based lock file, i've also updated the Dockerfile
2 months ago
also, pro tip, click the view in context button
2 months ago
what is three-perf?
2 months ago
we love when packages run git clones, the node ecosystem is lovely
2 months ago
the only savior is go
2 months ago
i dont think so, i say just try to redeploy
2 months ago
was worth a shot
2 months ago
back to node it is
2 months ago
yeah
2 months ago
good old node
fwiw, we have two other services running with bun with no issue (back end services though)
like we had the front end service running with bun up til yesterday when it suddenly stopped serving files
2 months ago
i think you had it running with node technically, given your start command
2 months ago
bun is a mystery
2 months ago
sounds good, glad i could help
2 months ago
diffrent container runtime?, who really knows
2 months ago
interesting