Railway SvelteKit deploy doesn't match local configuration

a year ago

I have a SvelteKit app that hosts a client project--a dashboard. The client sent me a static landing page to host on the same domain and project as the dashboard. The carousel--the main issue with the production deploy--works fine locally, as seen in the first image. However, in the production deploy, it looks different, as seen in the second image.

The landing page uses slick to provide the carousel, which has a dependance on jQuery. Here's the start of the +page.svelte file that serves the static page:

I've also verified that the network tab on both localhost & the production deploy match up, and they do. Additionally, I've also cleared my cache numerous times. I'm not sure where to head next

0 Replies

a year ago

508c7ca5-c96e-45d5-b72b-e1a3ffa14809


a year ago

send me link so I could check it?


a year ago

https://rapidtrack.xyz/ <- production deploy


a year ago

what node version are you using locally


a year ago

v20.10.0


a year ago

what version is railway building and running your app with


a year ago

it uses the nixpacks default; so 18 i believe


a year ago

welp get it using 20


a year ago

engines.node set to 20


a year ago

ye 1m


a year ago

tried through both package.json & the nixpacks env variable but no luck


a year ago

what is the build on railway using now?


a year ago

json "engines": { "node": "20" },


a year ago

it's set to 20


a year ago

right but what is the build using


a year ago

```
╔════════════ Nixpacks v1.21.2 ════════════╗

║ setup │ nodejs20, npm-9x ║

║──────────────────────────────────────────║

║ install │ npm ci ║

║──────────────────────────────────────────║

║ build │ npm run build ║

║──────────────────────────────────────────║

║ start │ node -r dotenv/config build ║

╚══════════════════════════════════════════╝```


a year ago

node -r dotenv/config build seems odd?


a year ago

it's for the sveltekit node adapter


a year ago

but the dotenv/config part?


a year ago

1220990672442622000


a year ago

not that its the issue, but you dont use dotenv on railway. so set your start command back to the default of node build

have you ran npm run build && node build locally?


a year ago

yeah i swapped the build command back


a year ago

using node build locally opens the server just fine but the carousel is still broken


a year ago

broken locally?


a year ago

yes


a year ago

didnt you say it worked locally?


a year ago

works using docker & vite locally


a year ago

it might be the adapter then


a year ago

so it wouldnt be broken anymore if you ran vite dev locally?


a year ago

let me see


a year ago

yeah looks fine


a year ago

not a railway issue, you know what that means 🙂


a year ago

yeah


a year ago

at least it was narrowed down


a year ago

progress!


Railway SvelteKit deploy doesn't match local configuration - Railway Help Station