Nextjs 13 - Error: Docker build failed
syahmirafsan
HOBBYOP

3 years ago

Here is my project ID: 28f33571-0170-4ed4-8184-c8c241e92abc

15 Replies

syahmirafsan
HOBBYOP

3 years ago

Tried npm run build and it worked nicely locally


syahmirafsan
HOBBYOP

3 years ago

This is the full build logs


syahmirafsan
HOBBYOP

3 years ago

#4 [stage-0 1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1673375667@sha256:528931c0e3ba98f759dc91b36522b8c1743ad85152447d282b427d5f04914af7

#4 sha256:45b8a7aac880bd83a4a72f1829fc36d831784fd9888bfa84a29f6718b1baf49d

#4 DONE 0.0s

#6 [internal] load build context

#6 sha256:4b45411218c174fa4781617fe1e0d9a4d1b9f3421fb3ff5c8c3a30faa7c2f7b8

#6 transferring context: 143.36kB done

#6 DONE 0.5s


syahmirafsan
HOBBYOP

3 years ago

#5 [stage-0 2/10] WORKDIR /app/

#5 sha256:bbd825bd1b472a0ab5d7ac76fbd4e9a78b084f218bdd438e040e31b97130ffde

#5 CACHED

#7 [stage-0 3/10] COPY .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix

#7 sha256:0cda285be9a5c5eef1ecb134c66b24760a983d6af0ed07c48698cae60ecf5bf7

#7 CACHED

#8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d

#8 sha256:2e5708f438cfe91e42577324322bfc45231a9d82ad93092a5bfc4b33b028f3bf

#8 CACHED


syahmirafsan
HOBBYOP

3 years ago

#9 [stage-0 5/10] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile

#9 sha256:6451ce3b9b25b8076f10970608a4df0793ff644a7bebf741196840715409d24a

#9 DONE 1.4s

#10 [stage-0 6/10] COPY . /app/.

#10 sha256:5fd900a648229cdd68cacf0ae543e55cfb5ff7de1b600f1aea97d51136b07e4f

#10 DONE 1.0s


syahmirafsan
HOBBYOP

3 years ago

#11 [stage-0 7/10] RUN --mount=type=cache,id=s/fd00b819-1372-4534-b55f-cb55d1db135b-/root/npm,target=/root/.npm npm ci

#11 sha256:b1537c32a7b0e587c13e9a64d68541e09cf8bc75d12d8c22485c7e7b2b5d54a0

#11 1.522 npm WARN config production Use --omit=dev instead.

#11 1.810 npm ERR! code EUSAGE

#11 1.813 npm ERR!

#11 1.813 npm ERR! npm ci can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with npm install before continuing.

#11 1.813 npm ERR!

#11 1.813 npm ERR! Missing: postcss@8.4.21 from lock file

#11 1.813 npm ERR!

#11 1.813 npm ERR! Clean install a project

#11 1.813 npm ERR!

#11 1.813 npm ERR! Usage:

#11 1.814 npm ERR! npm ci

#11 1.814 npm ERR!

#11 1.814 npm ERR! Options:

#11 1.814 npm ERR! [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]

#11 1.814 npm ERR! [-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]

#11 1.814 npm ERR! [--omit [--omit ...]]

#11 1.814 npm ERR! [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]

#11 1.814 npm ERR! [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]

#11 1.814 npm ERR! [-w|--workspace [-w|--workspace ...]]

#11 1.814 npm ERR! [-ws|--workspaces] [--include-workspace-root] [--install-links]

#11 1.814 npm ERR!

#11 1.814 npm ERR! aliases: clean-install, ic, install-clean, isntall-clean

#11 1.814 npm ERR!

#11 1.814 npm ERR! Run "npm help ci" for more info

#11 1.816

#11 1.816 npm ERR! A complete log of this run can be found in:

#11 1.816 npm ERR! /root/.npm/_logs/2023-01-24T19_52_39_285Z-debug-0.log


syahmirafsan
HOBBYOP

3 years ago

#11 ERROR: executor failed running [/bin/bash -ol pipefail -c npm ci]: exit code: 1

[stage-0 7/10] RUN --mount=type=cache,id=s/fd00b819-1372-4534-b55f-cb55d1db135b-/root/npm,target=/root/.npm npm ci:


executor failed running [/bin/bash -ol pipefail -c npm ci]: exit code: 1

Error: Docker build failed


syahmirafsan
HOBBYOP

3 years ago

I tried deleting my package lock and npm i again but to no avail


syahmirafsan
HOBBYOP

3 years ago

This is a fresh nextjs + taillwind project. Just configured everything 3 hour ago


syahmirafsan
HOBBYOP

3 years ago

Solved


syahmirafsan
HOBBYOP

3 years ago

Manually changed postcss to 8.4.21 on my package json and npm i


syahmirafsan
HOBBYOP

3 years ago

Not sure if it will affect the project in the long run though


finn
HOBBY

3 years ago

You can revert that change if you want and just run npm i


finn
HOBBY

3 years ago

Then commit those changes


Anonymous
TRIAL

2 years ago

f


Welcome!

Sign in to your Railway account to join the conversation.

Loading...