Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug UI Dockerfile fails to build #10914

Closed
jancionear opened this issue Apr 2, 2024 · 2 comments · Fixed by #10917
Closed

Debug UI Dockerfile fails to build #10914

jancionear opened this issue Apr 2, 2024 · 2 comments · Fixed by #10917
Labels
C-bug Category: This is a bug

Comments

@jancionear
Copy link
Contributor

I tried to build the debug-ui Dockerfile, following the instructions in https://github.com/near/nearcore/tree/master/tools/debug-ui#how-to-deploy-in-production , but it fails with an error:

~/nearcore/tools/debug-ui$ sudo docker build . -t debugui --no-cache
[+] Building 55.0s (15/17)                                                                                                                                                                                                                                     docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                     0.0s
 => => transferring dockerfile: 496B                                                                                                                                                                                                                                     0.0s
 => [internal] load metadata for docker.io/library/nginx:1.25.4-alpine                                                                                                                                                                                                   0.4s
 => [internal] load metadata for docker.io/library/node:19-alpine                                                                                                                                                                                                        0.4s
 => [internal] load .dockerignore                                                                                                                                                                                                                                        0.0s
 => => transferring context: 61B                                                                                                                                                                                                                                         0.0s
 => [build 1/9] FROM docker.io/library/node:19-alpine@sha256:8ec543d4795e2e85af924a24f8acb039792ae9fe8a42ad5b4bf4c277ab34b62e                                                                                                                                            0.0s
 => CACHED [stage-1 1/3] FROM docker.io/library/nginx:1.25.4-alpine@sha256:31bad00311cb5eeb8a6648beadcf67277a175da89989f14727420a80e2e76742                                                                                                                              0.0s
 => [internal] load build context                                                                                                                                                                                                                                        0.0s
 => => transferring context: 3.80kB                                                                                                                                                                                                                                      0.0s
 => CACHED [build 2/9] WORKDIR /build                                                                                                                                                                                                                                    0.0s
 => [build 3/9] ADD package.json /build/package.json                                                                                                                                                                                                                     0.0s
 => [build 4/9] ADD package-lock.json /build/package-lock.json                                                                                                                                                                                                           0.0s
 => [build 5/9] RUN npm install                                                                                                                                                                                                                                         27.1s
 => [build 6/9] ADD src /build/src                                                                                                                                                                                                                                       0.0s 
 => [build 7/9] ADD public /build/public                                                                                                                                                                                                                                 0.0s 
 => [build 8/9] ADD tsconfig.json /build/tsconfig.json                                                                                                                                                                                                                   0.0s 
 => ERROR [build 9/9] RUN npm run build                                                                                                                                                                                                                                 27.3s 
------                                                                                                                                                                                                                                                                        
 > [build 9/9] RUN npm run build:                                                                                                                                                                                                                                             
0.541                                                                                                                                                                                                                                                                         
0.541 > debug-ui@0.1.0 build                                                                                                                                                                                                                                                  
0.541 > react-scripts build                                                                                                                                                                                                                                                   
0.541                                                                                                                                                                                                                                                                         
2.143 Creating an optimized production build...
2.291 Browserslist: caniuse-lite is outdated. Please run:
2.291   npx update-browserslist-db@latest
2.291   Why you should do it regularly: https://github.com/browserslist/update-db#readme
26.06 Browserslist: caniuse-lite is outdated. Please run:
26.06   npx update-browserslist-db@latest
26.06   Why you should do it regularly: https://github.com/browserslist/update-db#readme
27.18 Failed to compile.
27.18 
27.18 TS7016: Could not find a declaration file for module 'react-query'. '/build/node_modules/react-query/build/cjs/packages/react-query/src/index.js' implicitly has an 'any' type.
27.18   Try `npm i --save-dev @types/react-query` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-query';`
27.18     1 | import './BlocksView.scss';
27.18   > 2 | import { useQuery } from 'react-query';
27.18       |                          ^^^^^^^^^^^^^
27.18     3 | import { fetchChainProcessingStatus, BlockProcessingStatus, ChunkProcessingStatus } from './api';
27.18     4 |
27.18     5 | type BlocksViewProps = {
27.18 
27.18 
------
Dockerfile:11
--------------------
   9 |     ADD public /build/public
  10 |     ADD tsconfig.json /build/tsconfig.json
  11 | >>> RUN npm run build
  12 |     
  13 |     # Serving does not require npm; simple nginx is good enough; it's just some
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1

Git commit: f37edc0 (latest master at the time of writing)

I'm unable to use debug-ui because of it.

Btw, it would be awesome if we could publish docker images of debug-ui on the dockerhub

@jancionear jancionear added the C-bug Category: This is a bug label Apr 2, 2024
@jancionear
Copy link
Contributor Author

jancionear commented Apr 2, 2024

I bisected the problem down to #10282. The Dockerfile builds before this commit, but fails after it.

@jancionear
Copy link
Contributor Author

cc @saketh-are, afair you fixed some similar issues recently (?)

jancionear added a commit to jancionear/nearcore that referenced this issue Apr 2, 2024
Fixes: near#10914

I'm not sure if that's the proper solution, would appreciate
a review from someone familiar with the javascript ecosystem.

I found this solution on stackoverflow:
https://stackoverflow.com/questions/73207151/could-not-find-a-declaration-file-for-module-react-query

 #Pleas enter the commit message for your changes. Lines starting
github-merge-queue bot pushed a commit that referenced this issue Apr 10, 2024
Fixes: #10914

I'm not sure if that's the proper solution, would appreciate a review
from someone familiar with the javascript ecosystem.

I found this solution on stackoverflow:

https://stackoverflow.com/questions/73207151/could-not-find-a-declaration-file-for-module-react-query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant