Deploy crashing

theoriginalhats
FREE

5 months ago

everytime i try to redeploy my project it ends up crashing a couple seconds later

Solved

0 Replies

theoriginalhats
FREE

5 months ago

f99bc61f-2053-4bd0-b638-c0ea4289d6de


5 months ago

This is most likely a problem with your code or you are exceeding your plan's limits


5 months ago

Mind sharing your deploy logs?


theoriginalhats
FREE

5 months ago

this is the error i get:
```
Starting Container

npm warn config production Use --omit=dev instead.

npm error Missing script: "tailwind.config.js"

npm error

npm error To see a list of scripts, run:

npm error npm run

npm error A complete log of this run can be found in: /root/.npm/logs/2025-02-11T222230993Z-debug-0.log

npm warn config production Use --omit=dev instead.

npm error Missing script: "tailwind.config.js"

npm error

npm error To see a list of scripts, run:

npm error npm run

npm error A complete log of this run can be found in: /root/.npm/logs/2025-02-11T222233908Z-debug-0.log```


theoriginalhats
FREE

5 months ago

i still have $4+ left


5 months ago

Did you commit the tailwind config file?


theoriginalhats
FREE

5 months ago

i did yes


5 months ago

are you sure you are not using Tailwind V4?


theoriginalhats
FREE

5 months ago

3.4.1


5 months ago

I honestly have no idea then


theoriginalhats
FREE

5 months ago

thanks for trying to help


5 months ago

you have your start command set to npm run tailwind.config.js


5 months ago

what kind of app is this


theoriginalhats
FREE

5 months ago

i made some slight updates but now i cant uplaod my "node_modules" folder to github


theoriginalhats
FREE

5 months ago

it says too many files


5 months ago

you wouldnt want to be uploading that folder to begin with


theoriginalhats
FREE

5 months ago

then what should i do?


5 months ago

^


theoriginalhats
FREE

5 months ago

what do you mean what kind of app?


5 months ago

my apologies, im going to have to step out here and let the community involve themselves


theoriginalhats
FREE

5 months ago

alright no problem


5 months ago

  1. You should have a .gitignore file that has the node_modules directory listed.

  2. Delete the nodemodules directory and commit the removal of this directory with the addition of the said .gitignore file, this way you won't accidentally commit your nodemodules again.

  3. After you have committed those changes, you will have to run npm install to download all dependencies again.

  4. How do you build/start your app? It definitely isn't npm run tailwind.config.js since that's a config file. Also, what kind of app is it, is it an API server, an entire full stack application, etc.?



theoriginalhats
FREE

5 months ago

its a website


5 months ago

How do you run it locally?


theoriginalhats
FREE

5 months ago

running it from github


5 months ago

<:oop:1231933790671208499>


5 months ago

No, like what do you run in your terminal to run it. For example: node app.js


theoriginalhats
FREE

5 months ago

npm run build


5 months ago

That's your build command


5 months ago

Anyway, remove your custom start command and redeploy it with the changes I have sent above


theoriginalhats
FREE

5 months ago

where do i run npm install


5 months ago

Locally


5 months ago

That is, if you want to run your application on your local machine first, to ensure that it is actually working.


theoriginalhats
FREE

4 months ago

alright i figured out i had to run npm install and then do npm run dev


theoriginalhats
FREE

4 months ago

on my local machine


4 months ago

great


4 months ago

can I assume that your repo is now cleaned up and ready for being deployed on railway?


theoriginalhats
FREE

4 months ago

but now on railway my build command is set to npm install and start command to npm run dev, its not crashing but im getting bad gateway error


4 months ago

you shouldn't run npm run dev, since that's the development server


theoriginalhats
FREE

4 months ago

so what should i run?


4 months ago

npm run start


4 months ago

However, can I see your package.json?


4 months ago

Just the script part such as:

"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start",
  "lint": "next lint"
},

theoriginalhats
FREE

4 months ago

json "scripts": { "start": "node server.js", "dev": "vite", "build": "vite build", "lint": "eslint .", "preview": "vite preview" },


theoriginalhats
FREE

4 months ago

got this error now

```err
node:internal/modules/cjs/loader:1143

throw err;

^

Error: Cannot find module '/app/server.js'

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

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

at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)

at node:internal/main/run_main_module:28:49 {

code: 'MODULENOTFOUND',

requireStack: []

}

Node.js v18.20.5```


4 months ago

Do you actually have server.js committed? Can I see your repository?


theoriginalhats
FREE

4 months ago

i changed it to:

json "scripts": { "start": "vite", "dev": "vite", "build": "vite build", "lint": "eslint .", "preview": "vite preview" },


theoriginalhats
FREE

4 months ago

but its on localhost and not my domain


4 months ago

does it work locally?


theoriginalhats
FREE

4 months ago

yep


4 months ago

also the production build? as in npm run build && npm run start


theoriginalhats
FREE

4 months ago

npm run build gives a error


theoriginalhats
FREE

4 months ago

so i have npm install instead


4 months ago

I meant locally, can you run it with npm run build && npm run start?


theoriginalhats
FREE

4 months ago

yep


theoriginalhats
FREE

4 months ago

1339367790989017000


4 months ago

great, try deploying it to railway now


theoriginalhats
FREE

4 months ago

error
```
vite v5.4.14 building for production…

transforming…

✓ 2 modules transformed.

x Build failed in 53ms

error during build:
[vite]: Rollup failed to resolve import "/src/main.tsx" from "/app/index.html".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
at viteWarn (file:///app/nodemodules/vite/dist/node/chunks/dep-CHZK6zbr.js:65747:17) at onwarn (file:///app/nodemodules/@vitejs/plugin-react/dist/index.mjs:273:9)
at onRollupWarning (file:///app/nodemodules/vite/dist/node/chunks/dep-CHZK6zbr.js:65777:5) at onwarn (file:///app/nodemodules/vite/dist/node/chunks/dep-CHZK6zbr.js:65442:7)
at file:///app/nodemodules/rollup/dist/es/shared/node-entry.js:19393:13 at Object.logger as onLog at ModuleLoader.handleInvalidResolvedId (file:///app/nodemodules/rollup/dist/es/shared/node-entry.js:20008:26)
at file:///app/node_modules/rollup/dist/es/shared/node-entry.js:19966:26

✕ [stage-0 8/10] RUN --mount=type=cache,id=s/5dad21a0-5134-4502-a4c8-c9fb5b424260-nodemodules/cache,target=/app/nodemodules/.cache npm run build
process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1

Dockerfile:24

22 | # build phase

23 | COPY . /app/.

24 | >>> RUN --mount=type=cache,id=s/5dad21a0-5134-4502-a4c8-c9fb5b424260-nodemodules/cache,target=/app/nodemodules/.cache npm run build

25 |

26 |

ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1

Error: Docker build failed```


4 months ago

Can I see your repo?


theoriginalhats
FREE

4 months ago


4 months ago

As the build logs suggest, you are referencing something that doesn't exists, there is no src directory in the repository above.


4 months ago

I have attached a screenshot of your repository and a snippet of your index.html.

1339661993539539000
1339661993828941800


theoriginalhats
FREE

4 months ago

completely forgot abt this


theoriginalhats
FREE

4 months ago

but i fixed that


theoriginalhats
FREE

4 months ago

and now npm run build works


theoriginalhats
FREE

4 months ago

i get this

1340721492169589000


4 months ago

You changed the start command to just vite again, which starts the dev server.


theoriginalhats
FREE

4 months ago

o so what should i change it to?


4 months ago

You need a web server to serve your static asset(s). Previously, you were using or at least attempted to use express as such. You can also use caddy, please refer to this template in this case https://railway.com/template/NeiLty


4 months ago

!s


Status changed to Solved brody 4 months ago


Deploy crashing - Railway Help Station