我不能在docker中构建我的nextjs应用程序,但是在本地它没有任何错误。我添加了我的nextjs配置output: 'standalone'
。我整个项目都是用纱线制作的。
我的Dockerfile与https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile完全相同,dockerignore与https://github.com/vercel/next.js/blob/canary/examples/with-docker/.dockerignore完全相同
错误:
#13 0.556 $ next build
#13 0.866 info - Loaded env from /app/.env
#13 1.081 Attention: Next.js now collects completely anonymous telemetry regarding usage.
#13 1.081 This information is used to shape Next.js' roadmap and prioritize features.
#13 1.081 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:
#13 1.081 https://nextjs.org/telemetry
#13 1.081
#13 1.198 info - Linting and checking validity of types...
#13 1.544 error - ESLint must be installed in order to run during builds: yarn add --dev eslint
#13 1.552 info - Creating an optimized production build...
#13 10.49 info - Compiled successfully
#13 10.49 info - Collecting page data...
#13 11.45 node:internal/child_process/serialization:127
#13 11.45 const string = JSONStringify(message) + '\n';
#13 11.45 ^
#13 11.45
#13 11.45 TypeError: Converting circular structure to JSON
#13 11.45 --> starting at object with constructor 'Socket'
#13 11.45 | property '_httpMessage' -> object with constructor 'ClientRequest'
#13 11.45 --- property 'socket' closes the circle
#13 11.45 at stringify (<anonymous>)
#13 11.45 at writeChannelMessage (node:internal/child_process/serialization:127:20)
#13 11.45 at process.target._send (node:internal/child_process:839:17)
#13 11.45 at process.target.send (node:internal/child_process:739:19)
#13 11.45 at reportError (/app/node_modules/next/dist/compiled/jest-worker/processChild.js:1:1995)
#13 11.45 at reportClientError (/app/node_modules/next/dist/compiled/jest-worker/processChild.js:1:1671)
#13 11.45 at processTicksAndRejections (node:internal/process/task_queues:96:5)
#13 12.07 node:internal/child_process/serialization:127
#13 12.07 const string = JSONStringify(message) + '\n';
#13 12.07 ^
#13 12.07
#13 12.07 TypeError: Converting circular structure to JSON
#13 12.07 --> starting at object with constructor 'Socket'
#13 12.07 | property '_httpMessage' -> object with constructor 'ClientRequest'
#13 12.07 --- property 'socket' closes the circle
#13 12.07 at stringify (<anonymous>)
#13 12.07 at writeChannelMessage (node:internal/child_process/serialization:127:20)
#13 12.07 at process.target._send (node:internal/child_process:839:17)
#13 12.07 at process.target.send (node:internal/child_process:739:19)
#13 12.07 at reportError (/app/node_modules/next/dist/compiled/jest-worker/processChild.js:1:1995)
#13 12.07 at reportClientError (/app/node_modules/next/dist/compiled/jest-worker/processChild.js:1:1671)
#13 12.07 at processTicksAndRejections (node:internal/process/task_queues:96:5)
#13 12.67 node:internal/child_process/serialization:127
#13 12.67 const string = JSONStringify(message) + '\n';
#13 12.67 ^
#13 12.67
#13 12.67 TypeError: Converting circular structure to JSON
#13 12.67 --> starting at object with constructor 'Socket'
#13 12.67 | property '_httpMessage' -> object with constructor 'ClientRequest'
#13 12.67 --- property 'socket' closes the circle
#13 12.67 at stringify (<anonymous>)
#13 12.67 at writeChannelMessage (node:internal/child_process/serialization:127:20)
#13 12.67 at process.target._send (node:internal/child_process:839:17)
#13 12.67 at process.target.send (node:internal/child_process:739:19)
#13 12.67 at reportError (/app/node_modules/next/dist/compiled/jest-worker/processChild.js:1:1995)
#13 12.67 at reportClientError (/app/node_modules/next/dist/compiled/jest-worker/processChild.js:1:1671)
#13 12.67 at processTicksAndRejections (node:internal/process/task_queues:96:5)
#13 13.29 node:internal/child_process/serialization:127
#13 13.29 const string = JSONStringify(message) + '\n';
#13 13.29 ^
#13 13.29
#13 13.29 TypeError: Converting circular structure to JSON
#13 13.29 --> starting at object with constructor 'Socket'
#13 13.29 | property '_httpMessage' -> object with constructor 'ClientRequest'
#13 13.29 --- property 'socket' closes the circle
#13 13.29 at stringify (<anonymous>)
#13 13.29 at writeChannelMessage (node:internal/child_process/serialization:127:20)
#13 13.29 at process.target._send (node:internal/child_process:839:17)
#13 13.29 at process.target.send (node:internal/child_process:739:19)
#13 13.29 at reportError (/app/node_modules/next/dist/compiled/jest-worker/processChild.js:1:1995)
#13 13.29 at reportClientError (/app/node_modules/next/dist/compiled/jest-worker/processChild.js:1:1671)
#13 13.29 at processTicksAndRejections (node:internal/process/task_queues:96:5)
#13 13.30
#13 13.30 > Build error occurred
#13 13.31 Error: Call retries were exceeded
#13 13.31 at ChildProcessWorker.initialize (/app/node_modules/next/dist/compiled/jest-worker/index.js:1:11661)
#13 13.31 at ChildProcessWorker._onExit (/app/node_modules/next/dist/compiled/jest-worker/index.js:1:12599)
#13 13.31 at ChildProcess.emit (node:events:527:28)
#13 13.31 at ChildProcess.emit (node:domain:475:12)
#13 13.31 at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
#13 13.31 type: 'WorkerError'
#13 13.31 }
#13 13.34 error Command failed with exit code 1.
#13 13.34 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
executor failed running [/bin/sh -c yarn build]: exit code: 1
https://stackoverflow.com/questions/73077293
复制相似问题