how do i fix this error

ogbcode
PROOP

a month ago

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

> crypto-checkout-page@0.1.0 build

> next build

Attention: Next.js now collects completely anonymous telemetry regarding usage.

This information is used to shape Next.js' roadmap and prioritize features.

You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:

https://nextjs.org/telemetry

▲ Next.js 15.2.4

Creating an optimized production build ...

Failed to compile.

app/layout.tsx

An error occurred in next/font.

Error: Cannot find module '../lightningcss.linux-x64-gnu.node'

Require stack:

- /app/node_modules/lightningcss/node/index.js

- /app/node_modules/@tailwindcss/node/dist/index.js

- /app/node_modules/@tailwindcss/postcss/dist/index.js

- /app/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js

- /app/node_modules/next/dist/build/webpack/config/blocks/css/index.js

- /app/node_modules/next/dist/build/webpack/config/index.js

- /app/node_modules/next/dist/build/webpack-config.js

- /app/node_modules/next/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js

- /app/node_modules/next/dist/build/collect-build-traces.js

- /app/node_modules/next/dist/build/index.js

- /app/node_modules/next/dist/cli/next-build.js

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

at /app/node_modules/next/dist/server/require-hook.js:55:36

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

at Module.require (node:internal/modules/cjs/loader:1231:19)

at mod.require (/app/node_modules/next/dist/server/require-hook.js:65:28)

at require (node:internal/modules/helpers:177:18)

at Object.<anonymous> (/app/node_modules/lightningcss/node/index.js:22:22)

at Module._compile (node:internal/modules/cjs/loader:1364:14)

at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)

at Module.load (node:internal/modules/cjs/loader:1203:32)

> Build failed because of webpack errors

Dockerfile:24

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

22 | # build phase

23 | COPY . /app/.

24 | >>> RUN --mount=type=cache,id=s/c656bea3-1381-426c-a82d-4481a9989580-next/cache,target=/app/.next/cache --mount=type=cache,id=s/c656bea3-1381-426c-a82d-4481a9989580-node_modules/cache,target=/app/node_modules/.cache npm run build

25 |

26 |

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

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

$10 Bounty

2 Replies

Railway
BOT

a month ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


fra
HOBBYTop 10% Contributor

a month ago

Can you try adding a file called .dockerignore in the root of your project and add node_modules inside?


Loading...
how do i fix this error - Railway Help Station