deploying sveltekit app

yashHOBBY

a year ago

After reviewing the railway sveltekit template I realized that adding "start" command to package.json is the key.

Adding

"start": "node build"
results in
Error: Cannot find module '/app/build'

Whats the right way to run a sveltekit app with node-adapter?

8 Replies

a year ago

You would need a build script, do you have one?


yashHOBBY

a year ago

No. I dont have one. Can you guide me? I dint see one in the railway template for svelte.



yashHOBBY

a year ago

Yup I do have that build line. However still encountering this error

```

node build

node:internal/modules/cjs/loader:1080

throw err;

^

Error: Cannot find module '/app/build'

at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)

at Module._load (node:internal/modules/cjs/loader:922:27)

at Function.executeUserEntryPoint as runMain

at node:internal/main/runmainmodule:23:47 {

code: 'MODULENOTFOUND',

requireStack: []

}

Node.js v18.18.2```


a year ago

Are you able to share your repo?


yashHOBBY

a year ago


a year ago

You weren't using the node adapter, I've made a PR to add that.

https://github.com/yashh/short/pull/1


yashHOBBY

a year ago

Thank you.


deploying sveltekit app - Railway Help Station