5 months ago
everytime i try to redeploy my project it ends up crashing a couple seconds later
0 Replies
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?
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```
5 months ago
Did you commit the tailwind config file?
5 months ago
are you sure you are not using Tailwind V4?
5 months ago
I honestly have no idea then
5 months ago
you have your start command set to npm run tailwind.config.js
5 months ago
what kind of app is this
i made some slight updates but now i cant uplaod my "node_modules" folder to github
5 months ago
you wouldnt want to be uploading that folder to begin with
5 months ago
^
5 months ago
my apologies, im going to have to step out here and let the community involve themselves
5 months 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 install
to download all dependencies again.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.?
5 months ago
5 months ago
How do you run it locally?
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
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
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.
alright i figured out i had to run npm install
and then do npm run dev
4 months ago
great
4 months 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
4 months ago
you shouldn't run npm run dev
, since that's the development server
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"
},
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```
4 months 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
4 months ago
does it work locally?
4 months ago
also the production build? as in npm run build
&& npm run start
4 months ago
I meant locally, can you run it with npm run build && npm run start?
4 months 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```
4 months ago
Can I see your repo?
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
.
4 months ago
You changed the start command to just vite
again, which starts the dev server.
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