a year ago
everytime i try to redeploy my project it ends up crashing a couple seconds later
71 Replies
a year ago
This is most likely a problem with your code or you are exceeding your plan's limits
a year ago
Mind sharing your deploy logs?
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```
a year ago
Did you commit the tailwind config file?
a year ago
are you sure you are not using Tailwind V4?
a year ago
I honestly have no idea then
a year ago
you have your start command set to npm run tailwind.config.js
a year ago
what kind of app is this
i made some slight updates but now i cant uplaod my "node_modules" folder to github
a year ago
you wouldnt want to be uploading that folder to begin with
a year ago
^
a year ago
my apologies, im going to have to step out here and let the community involve themselves
a year ago
You should have a .gitignore file that has the node_modules directory listed.
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.
After you have committed those changes, you will have to run
npm installto download all dependencies again.How do you build/start your app? It definitely isn't
npm run tailwind.config.jssince that's a config file. Also, what kind of app is it, is it an API server, an entire full stack application, etc.?
a year ago
a year ago
How do you run it locally?
a year ago
<:oop:1231933790671208499>
a year ago
No, like what do you run in your terminal to run it. For example: node app.js
a year ago
That's your build command
a year ago
Anyway, remove your custom start command and redeploy it with the changes I have sent above
a year ago
Locally
a year ago
That is, if you want to run your application on your local machine first, to ensure that it is actually working.
alright i figured out i had to run npm install and then do npm run dev
a year ago
great
a year ago
can I assume that your repo is now cleaned up and ready for being deployed on railway?
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
a year ago
you shouldn't run npm run dev, since that's the development server
a year ago
npm run start
a year ago
However, can I see your package.json?
a year ago
Just the script part such as:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},json "scripts": { "start": "node server.js", "dev": "vite", "build": "vite build", "lint": "eslint .", "preview": "vite preview" },
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```
a year ago
Do you actually have server.js committed? Can I see your repository?
i changed it to:
json "scripts": { "start": "vite", "dev": "vite", "build": "vite build", "lint": "eslint .", "preview": "vite preview" },
but its on localhost and not my domain
a year ago
does it work locally?
a year ago
also the production build? as in npm run build && npm run start
a year ago
I meant locally, can you run it with npm run build && npm run start?
a year ago
great, try deploying it to railway now
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 tobuild.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```
a year ago
Can I see your repo?
a year ago
As the build logs suggest, you are referencing something that doesn't exists, there is no src directory in the repository above.
a year ago
I have attached a screenshot of your repository and a snippet of your index.html.


a year ago
You changed the start command to just vite again, which starts the dev server.
a year 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
a year ago
!s
Status changed to Solved brody • 11 months ago

