how do i fix this?

freya-mikaelson
FREE

2 months ago

✕ [stage-0 13/15] RUN --mount=type=cache,id=s/6c70b4f0-7636-48be-af8a-6984d5cdc578-node_modules/cache,target=/app/node_modules/.cache npm run build

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

Dockerfile:30

-------------------

28 | # build phase

29 | COPY . /app/.

30 | >>> RUN --mount=type=cache,id=s/6c70b4f0-7636-48be-af8a-6984d5cdc578-node_modules/cache,target=/app/node_modules/.cache npm run build

31 |

32 |

-------------------

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

Error: Docker build failed

i cant seem to deploy this application.

Solved$5 Bounty

7 Replies

Railway
BOT

2 months ago


2 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody about 2 months ago


daheltechdev
HOBBY

2 months ago

Hey! That error means something went wrong during the npm run build step in your dockerfile but the exact cause should be visible in the build logs just above this error. I’d recommend scrolling up a bit in the deploy/build logs and checking what the actual issue was (could be a missing dependency, or something else failing in your project).

Also, you double-check that your build script in package.json works locally. if it doesn’t run on your machine, it won’t work in Railway either. Let me know what the logs say and I can help further!!!


freya-mikaelson
FREE

2 months ago

Okay! Give me a moment


freya-mikaelson
FREE

2 months ago

[stage-0 11/15] RUN --mount=type=cache,id=s/6c70b4f0-7636-48be-af8a-6984d5cdc578-/root/npm,target=/root/.npm npm ci 11 secs

[stage-0 12/15] COPY . /app/.

[stage-0 12/15] COPY . /app/. 314 ms

[stage-0 13/15] RUN --mount=type=cache,id=s/6c70b4f0-7636-48be-af8a-6984d5cdc578-node_modules/cache,target=/app/node_modules/.cache npm run build

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

> rest-express@1.0.0 build > vite build && esbuild server/index.ts --platform=node --packages=external --bundle --format=esm --outdir=dist

vite v5.4.14 building for production...

transforming...

Browserslist: browsers data (caniuse-lite) is 10 months old. Please run: npx update-browserslist-db@latest Why you should do it regularly: https://github.com/browserslist/update-db#readme

✓ 1678 modules transformed.

rendering chunks...

computing gzip size...

../dist/public/index.html 0.63 kB │ gzip: 0.38 kB

../dist/public/assets/index-BHNci-bG.css 82.84 kB │ gzip: 13.86 kB

../dist/public/assets/index-CGa2Uk1_.js 332.18 kB │ gzip: 102.98 kB

✓ built in 3.63s

✘ [ERROR] No matching export in "server/bot/commands/index.js" for import "default" server/bot/events/interactionCreate.ts:2:7: 2 │ import commands from "../commands/index"; ╵ ~~~~~~~~

1 error

✕ [stage-0 13/15] RUN --mount=type=cache,id=s/6c70b4f0-7636-48be-af8a-6984d5cdc578-node_modules/cache,target=/app/node_modules/.cache npm run build

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

Dockerfile:30

-------------------

28 | # build phase

29 | COPY . /app/.

30 | >>> RUN --mount=type=cache,id=s/6c70b4f0-7636-48be-af8a-6984d5cdc578-node_modules/cache,target=/app/node_modules/.cache npm run build

31 |

32 |

-------------------

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

Error: Docker build failed


Status changed to Solved freya-mikaelson about 2 months ago


freya-mikaelson
FREE

2 months ago

Oops


Status changed to Awaiting Railway Response Railway about 2 months ago


freya-mikaelson
FREE

2 months ago

I did not mean to solve it…


freya-mikaelson

[stage-0 11/15] RUN --mount=type=cache,id=s/6c70b4f0-7636-48be-af8a-6984d5cdc578-/root/npm,target=/root/.npm npm ci 11 secs[stage-0 12/15] COPY . /app/.[stage-0 12/15] COPY . /app/. 314 ms[stage-0 13/15] RUN --mount=type=cache,id=s/6c70b4f0-7636-48be-af8a-6984d5cdc578-node_modules/cache,target=/app/node_modules/.cache npm run buildnpm warn config production Use --omit=dev instead.> rest-express@1.0.0 build > vite build && esbuild server/index.ts --platform=node --packages=external --bundle --format=esm --outdir=distvite v5.4.14 building for production...transforming...Browserslist: browsers data (caniuse-lite) is 10 months old. Please run: npx update-browserslist-db@latest Why you should do it regularly: https://github.com/browserslist/update-db#readme✓ 1678 modules transformed.rendering chunks...computing gzip size...../dist/public/index.html 0.63 kB │ gzip: 0.38 kB../dist/public/assets/index-BHNci-bG.css 82.84 kB │ gzip: 13.86 kB../dist/public/assets/index-CGa2Uk1_.js 332.18 kB │ gzip: 102.98 kB✓ built in 3.63s✘ [ERROR] No matching export in "server/bot/commands/index.js" for import "default" server/bot/events/interactionCreate.ts:2:7: 2 │ import commands from "../commands/index"; ╵ ~~~~~~~~1 error✕ [stage-0 13/15] RUN --mount=type=cache,id=s/6c70b4f0-7636-48be-af8a-6984d5cdc578-node_modules/cache,target=/app/node_modules/.cache npm run buildprocess "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1Dockerfile:30-------------------28 | # build phase29 | COPY . /app/.30 | >>> RUN --mount=type=cache,id=s/6c70b4f0-7636-48be-af8a-6984d5cdc578-node_modules/cache,target=/app/node_modules/.cache npm run build31 |32 |-------------------ERROR: failed to build: failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1Error: Docker build failed

daheltechdev
HOBBY

2 months ago

I see the problem now, your build is failing because you're trying to use import commands from ..., but the file you're importing from doesn’t have a default export. To fix this, you can either Add a default export to the file. For example, if you currently have:

export const something = ...

You can change it to: const commands = { ... };

export default commands;

OR

If you want to keep using named exports, just update the import like this:

import * as commands from "../commands/index";


Status changed to Solved brody about 2 months ago