jsoncrack.com icon indicating copy to clipboard operation
jsoncrack.com copied to clipboard

[BUG]: <cannot build a docker image>

Open XiexieYang opened this issue 2 years ago • 10 comments

Issue description

Step 5/8 : RUN yarn run build
---> Running in 3686fa68f241
yarn run v1.22.19
$ next build && next export
info  - Loaded env from /src/.env.production
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

info  - Linting and checking validity of types...
info  - Creating an optimized production build...
> [PWA] Compile client (static)
> [PWA] Auto register service worker with: /src/node_modules/next-pwa/register.js
> [PWA] Service worker: /src/public/sw.js
> [PWA]   url: /sw.js
> [PWA]   scope: /editor/
> [PWA] Compile server
> [PWA] Compile server
info  - Loaded env from /src/.env.production
info  - using build directory: /src/.next
Error: Could not find a production build in the '/src/.next' directory. Try building your app with 'next build' before starting the static export. https://nextjs.org/docs/messages/next-export-no-build-id
    at /src/node_modules/next/dist/export/index.js:59:19
    at async Span.traceAsyncFn (/src/node_modules/next/dist/trace/trace.js:79:20)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command '/bin/sh -c yarn run build' returned a non-zero code: 1

Media & Screenshots

No response

Operating system

  • OS: Centos 8 stream:
  • Docker version 20.10.22, build 3a2c30b

Priority this issue should have

Medium (should be fixed soon)

XiexieYang avatar Jan 05 '23 07:01 XiexieYang

Its working on Linux and Mac, I am not sure if this is only on specifc OS. I am new here, how do you check a dockerfile for all different OS, do you just run them on an emulator?

shubhe25p avatar Jan 06 '23 21:01 shubhe25p

Same issue here, on MacOS ARM

[+] Building 237.8s (13/15)                                                                                                                                                                                                                                                            
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                              0.0s
 => => transferring dockerfile: 168B                                                                                                                                                                                                                                              0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                   0.0s
 => [internal] load metadata for docker.io/nginxinc/nginx-unprivileged:latest                                                                                                                                                                                                     1.7s
 => [internal] load metadata for docker.io/library/node:14-buster                                                                                                                                                                                                                 1.8s
 => [auth] nginxinc/nginx-unprivileged:pull token for registry-1.docker.io                                                                                                                                                                                                        0.0s
 => [auth] library/node:pull token for registry-1.docker.io                                                                                                                                                                                                                       0.0s
 => [builder 1/5] FROM docker.io/library/node:14-buster@sha256:0c888dc647d36f5a895edb6b1b1c96ae81064455e0cdeee0792e14927604ca99                                                                                                                                                   0.0s
 => [internal] load build context                                                                                                                                                                                                                                                 0.0s
 => => transferring context: 1.43MB                                                                                                                                                                                                                                               0.0s
 => CACHED [stage-1 1/3] FROM docker.io/nginxinc/nginx-unprivileged@sha256:2874ba155bf0852427ea0254edeba824186911ff0299df61ff88527d29594983                                                                                                                                       0.0s
 => CACHED [builder 2/5] WORKDIR /src                                                                                                                                                                                                                                             0.0s
 => [builder 3/5] COPY . /src                                                                                                                                                                                                                                                     0.1s
 => [builder 4/5] RUN yarn install --legacy-peer-deps                                                                                                                                                                                                                           173.8s
 => ERROR [builder 5/5] RUN yarn run build                                                                                                                                                                                                                                       62.0s
------                                                                                                                                                                                                                                                                                 
 > [builder 5/5] RUN yarn run build:                                                                                                                                                                                                                                                   
#12 1.781 yarn run v1.22.19                                                                                                                                                                                                                                                            
#12 2.007 $ next build && next export                                                                                                                                                                                                                                                  
#12 4.111 info  - Loaded env from /src/.env.production                                                                                                                                                                                                                                 
#12 8.074 Attention: Next.js now collects completely anonymous telemetry regarding usage.                                                                                                                                                                                              
#12 8.074 This information is used to shape Next.js' roadmap and prioritize features.
#12 8.074 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:
#12 8.074 https://nextjs.org/telemetry
#12 8.074 
#12 8.618 info  - Linting and checking validity of types...
#12 17.41 error - ESLint: Failed to load plugin 'testing-library' declared in '.eslintrc.json#overrides[0]': Cannot find module 'eslint-plugin-testing-library' Require stack: - /src/__placeholder__.js Referenced from: /src/.eslintrc.json
#12 56.44 info  - Creating an optimized production build...
#12 59.02 > [PWA] Compile client (static)
#12 59.02 > [PWA] Auto register service worker with: /src/node_modules/next-pwa/register.js
#12 59.02 > [PWA] Service worker: /src/public/sw.js
#12 59.02 > [PWA]   url: /sw.js
#12 59.02 > [PWA]   scope: /editor/
#12 59.51 > [PWA] Compile server
#12 60.50 > [PWA] Compile server
#12 61.36 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#12 61.58 Segmentation fault
#12 61.67 error Command failed with exit code 139.
#12 61.67 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
executor failed running [/bin/sh -c yarn run build]: exit code: 139

redtripleAAA avatar Jan 30 '23 18:01 redtripleAAA

Same issue on Windows with Docker using WSL2:

 => ERROR [builder 4/4] RUN yarn install --frozen-lockfile && yarn build                             115.1s
------
 > [builder 4/4] RUN yarn install --frozen-lockfile && yarn build:
#10 0.528 yarn install v1.22.19
#10 0.605 [1/4] Resolving packages...
#10 0.839 [2/4] Fetching packages...
#10 61.06 [3/4] Linking dependencies...
#10 61.07 warning " > @monaco-editor/[email protected]" has unmet peer dependency "monaco-editor@>= 0.25.0 < 1".
#10 61.07 warning "@monaco-editor/react > @monaco-editor/[email protected]" has unmet peer dependency "monaco-editor@>= 0.21.0 < 1".
#10 61.07 warning "react-hot-toast > [email protected]" has unmet peer dependency "csstype@^3.0.10".
#10 61.07 warning "reaflow > rdk > [email protected]" has incorrect peer dependency "react@^16.3.0".
#10 61.07 warning " > [email protected]" has unmet peer dependency "react-is@>= 16.8.0".
#10 75.88 [4/4] Building fresh packages...
#10 77.22 Done in 76.70s.
#10 77.36 yarn run v1.22.19
#10 77.40 $ next build && next export
#10 77.72 info  - Loaded env from /src/.env.production
#10 77.87 Attention: Next.js now collects completely anonymous telemetry regarding usage.
#10 77.87 This information is used to shape Next.js' roadmap and prioritize features.
#10 77.87 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:
#10 77.87 https://nextjs.org/telemetry
#10 77.87
#10 77.98 info  - Linting and checking validity of types...
#10 84.97 info  - Creating an optimized production build...
#10 104.3 ReferenceError: AbortController is not defined
#10 104.3     at fetchCSSFromGoogleFonts (/src/node_modules/next/dist/compiled/@next/font/dist/google/fetch-css-from-google-fonts.js:34:28)
#10 104.3     at nextFontGoogleFontLoader (/src/node_modules/next/dist/compiled/@next/font/dist/google/loader.js:76:79)
#10 104.3     at /src/node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js:72:99
#10 104.3     at async Span.traceAsyncFn (/src/node_modules/next/dist/trace/trace.js:79:20)
#10 114.7 Failed to compile.
#10 114.7
#10 114.7 src/components/CustomNode/styles.tsx
#10 114.7 `next/font` error:
#10 114.7 Failed to fetch `Roboto Mono` from Google Fonts.
#10 114.7
#10 114.7 src/components/CustomNode/styles.tsx
#10 114.7 An error occured in `next/font`.
#10 114.7
#10 114.7 NextFontError: Failed to fetch `Roboto Mono` from Google Fonts.
#10 114.7     at nextFontError (/src/node_modules/next/dist/compiled/@next/font/dist/next-font-error.js:8:17)
#10 114.7     at nextFontGoogleFontLoader (/src/node_modules/next/dist/compiled/@next/font/dist/google/loader.js:87:49)
#10 114.7     at async /src/node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js:72:93
#10 114.7     at async Span.traceAsyncFn (/src/node_modules/next/dist/trace/trace.js:79:20)
#10 114.7     at tryRunOrWebpackError (/src/node_modules/next/dist/compiled/webpack/bundle5.js:28:308539)
#10 114.7     at __webpack_require_module__ (/src/node_modules/next/dist/compiled/webpack/bundle5.js:28:130357)
#10 114.7     at __nested_webpack_require_153265__ (/src/node_modules/next/dist/compiled/webpack/bundle5.js:28:129784)
#10 114.7     at /src/node_modules/next/dist/compiled/webpack/bundle5.js:28:130649
#10 114.7     at symbolIterator (/src/node_modules/next/dist/compiled/neo-async/async.js:1:14444)
#10 114.7     at done (/src/node_modules/next/dist/compiled/neo-async/async.js:1:14824)
#10 114.7     at Hook.eval [as callAsync] (eval at create (/src/node_modules/next/dist/compiled/webpack/bundle5.js:13:28771), <anonymous>:15:1)
#10 114.7     at /src/node_modules/next/dist/compiled/webpack/bundle5.js:28:129504
#10 114.7     at symbolIterator (/src/node_modules/next/dist/compiled/neo-async/async.js:1:14402)
#10 114.7     at timesSync (/src/node_modules/next/dist/compiled/neo-async/async.js:1:5027)
#10 114.7 -- inner error --
#10 114.7 NextFontError: Failed to fetch `Roboto Mono` from Google Fonts.
#10 114.7     at nextFontError (/src/node_modules/next/dist/compiled/@next/font/dist/next-font-error.js:8:17)
#10 114.7     at nextFontGoogleFontLoader (/src/node_modules/next/dist/compiled/@next/font/dist/google/loader.js:87:49)
#10 114.7     at async /src/node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js:72:93
#10 114.7     at async Span.traceAsyncFn (/src/node_modules/next/dist/trace/trace.js:79:20)
#10 114.7     at Object.<anonymous> (/src/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[1].oneOf[3].use[1]!/src/node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js??ruleSet[1].rules[1].oneOf[3].use[2]!/src/node_modules/next/font/google/target.css?{"path":"src/components/CustomNode/styles.tsx","import":"Roboto_Mono","arguments":[{"weight":"500","subsets":["latin"],"display":"swap","fallback":["Arial, Helvetica, sans-serif","Tahoma, Verdana, sans-serif"]}],"variableName":"robotoMono"}:1:7)
#10 114.7     at /src/node_modules/next/dist/compiled/webpack/bundle5.js:28:901184
#10 114.7     at Hook.eval [as call] (eval at create (/src/node_modules/next/dist/compiled/webpack/bundle5.js:13:28549), <anonymous>:7:1)
#10 114.7     at /src/node_modules/next/dist/compiled/webpack/bundle5.js:28:130390
#10 114.7     at tryRunOrWebpackError (/src/node_modules/next/dist/compiled/webpack/bundle5.js:28:308493)
#10 114.7     at __webpack_require_module__ (/src/node_modules/next/dist/compiled/webpack/bundle5.js:28:130357)
#10 114.7     at __nested_webpack_require_153265__ (/src/node_modules/next/dist/compiled/webpack/bundle5.js:28:129784)
#10 114.7     at /src/node_modules/next/dist/compiled/webpack/bundle5.js:28:130649
#10 114.7     at symbolIterator (/src/node_modules/next/dist/compiled/neo-async/async.js:1:14444)
#10 114.7     at done (/src/node_modules/next/dist/compiled/neo-async/async.js:1:14824)
#10 114.7
#10 114.7 Generated code for /src/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[1].oneOf[3].use[1]!/src/node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js??ruleSet[1].rules[1].oneOf[3].use[2]!/src/node_modules/next/font/google/target.css?{"path":"src/components/CustomNode/styles.tsx","import":"Roboto_Mono","arguments":[{"weight":"500","subsets":["latin"],"display":"swap","fallback":["Arial, Helvetica, sans-serif","Tahoma, Verdana, sans-serif"]}],"variableName":"robotoMono"}
#10 114.7
#10 114.7
#10 114.7 > Build failed because of webpack errors
#10 114.8 error Command failed with exit code 1.
#10 114.8 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
executor failed running [/bin/sh -c yarn install --frozen-lockfile && yarn build]: exit code: 1

dmayilyan avatar Mar 16 '23 21:03 dmayilyan

Same issue running on windoss 11 wsl2, or on windows 11 tried both: docker build -t jsoncrack . and docker build -t jsoncrack --no-cache=true --platform=linux/amd64 . as mention in #307

ilayni avatar Mar 17 '23 12:03 ilayni

git checkout v2.6.0 seems to work, but not v2.8.0

sounddroid avatar Mar 19 '23 18:03 sounddroid

@sounddroid Tks a lot! that fixed the issue for now

ilayni avatar Mar 20 '23 05:03 ilayni

在windoss 11 wsl2或Windows 11上运行的相同问题尝试了两者:docker build -t jsoncrack。和 docker build -t jsoncrack --no-cache=true --platform=linux/amd64 。如#307 中所述

May I ask you just solve the problem? I am in the same situation as you.

17Reset avatar Mar 22 '23 05:03 17Reset

hi @17Reset, i did as @sounddroid advised and it worked for me so after you

  1. clone the repo you need to move to v2.6.0 i did
  2. git checkout v2.6.0 and than
  3. build the docker image. on step 2 you can also try git switch v2.6.0

ilayni avatar Mar 22 '23 17:03 ilayni

thanks @sounddroid . I change to old version v2.6.0 and it work for my macbook arm

sonnguyenHT avatar Apr 07 '23 17:04 sonnguyenHT

Sync the latest changes, docker file and docker configuration is working.

jinnabaalu avatar Sep 16 '23 20:09 jinnabaalu