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

[Bug] Docker Build failing at yarn run build #4172

Open
highoncarbs opened this issue May 24, 2024 · 11 comments
Open

[Bug] Docker Build failing at yarn run build #4172

highoncarbs opened this issue May 24, 2024 · 11 comments
Assignees
Labels
fixed-in-dev-await-release This issue is fixed in master (viewer-dev) but we are pending testing for release (viewer.ohif.org)

Comments

@highoncarbs
Copy link

highoncarbs commented May 24, 2024

Describe the Bug

I am building the docker image as described in the documentation. I did a fresh git clone and ran docker build. It fails to build the image, but a regular yarn run build is building the Viewer

Here's the error

44.68 @ohif/app: Circular dependency between chunks with runtime (app, polySeg, suv-peak-worker)
44.68 @ohif/app: This prevents using hashes of each other and should be avoided.
44.68 @ohif/app: ERROR in ../../../extensions/default/src/getCustomizationModule.tsx 3:0-83
44.68 @ohif/app: Module not found: Error: Can't resolve './components/ProgressDropdownWithService' in '/usr/src/app/extensions/default/src'
44.68 @ohif/app: Did you miss the leading dot in 'resolve.extensions'? Did you mean '[".js",".jsx",".json",".ts",".tsx",".*"]' instead of '[".js",".jsx",".json",".ts",".tsx","*"]'?
44.68 @ohif/app: resolve './components/ProgressDropdownWithService' in '/usr/src/app/extensions/default/src'
44.68 @ohif/app:   using description file: /usr/src/app/extensions/default/package.json (relative path: ./src)
44.68 @ohif/app:     Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:     using description file: /usr/src/app/extensions/default/package.json (relative path: ./src/components/ProgressDropdownWithService)
44.68 @ohif/app:       no extension
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService doesn't exist
44.68 @ohif/app:       .js
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.js doesn't exist
44.68 @ohif/app:       .jsx
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.jsx doesn't exist
44.68 @ohif/app:       .json
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.json doesn't exist
44.68 @ohif/app:       .ts
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.ts doesn't exist
44.68 @ohif/app:       .tsx
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.tsx doesn't exist
44.68 @ohif/app:       *
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService* doesn't exist
44.68 @ohif/app:       as directory
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService doesn't exist
44.68 @ohif/app:  @ ../../../extensions/default/src/index.ts 9:0-62 42:2-24
44.68 @ohif/app:  @ ./pluginImports.js
44.68 @ohif/app:  @ ./index.js 19:0-89 33:4-21 34:4-16
44.68 @ohif/app: ERROR in ../../../extensions/default/src/getToolbarModule.tsx 6:0-83
44.68 @ohif/app: Module not found: Error: Can't resolve './components/ProgressDropdownWithService' in '/usr/src/app/extensions/default/src'
44.68 @ohif/app: Did you miss the leading dot in 'resolve.extensions'? Did you mean '[".js",".jsx",".json",".ts",".tsx",".*"]' instead of '[".js",".jsx",".json",".ts",".tsx","*"]'?
44.68 @ohif/app: resolve './components/ProgressDropdownWithService' in '/usr/src/app/extensions/default/src'
44.68 @ohif/app:   using description file: /usr/src/app/extensions/default/package.json (relative path: ./src)
44.68 @ohif/app:     Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:     using description file: /usr/src/app/extensions/default/package.json (relative path: ./src/components/ProgressDropdownWithService)
44.68 @ohif/app:       no extension
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService doesn't exist
44.68 @ohif/app:       .js
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.js doesn't exist
44.68 @ohif/app:       .jsx
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.jsx doesn't exist
44.68 @ohif/app:       .json
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.json doesn't exist
44.68 @ohif/app:       .ts
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.ts doesn't exist
44.68 @ohif/app:       .tsx
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.tsx doesn't exist
44.68 @ohif/app:       *
44.68 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService* doesn't exist
44.68 @ohif/app:       as directory
44.68 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService doesn't exist
44.68 @ohif/app:  @ ../../../extensions/default/src/index.ts 5:0-50 30:2-18
44.68 @ohif/app:  @ ./pluginImports.js
44.68 @ohif/app:  @ ./index.js 19:0-89 33:4-21 34:4-16
44.68 @ohif/app: webpack 5.91.0 compiled with 2 errors and 1 warning in 34380 ms (cedfee9b9afaf58c5a09)
@ohif/app: error Command failed with exit code 1.
@ohif/app: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@ohif/app: error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
44.93
44.93
44.93
44.93  >  Lerna (powered by Nx)   Running target build:viewer for project @ohif/app failed
44.93
44.93    Failed tasks:
44.93
44.93    - @ohif/app:build:viewer
44.93
44.93    Hint: run the command with --verbose for more details.
44.93
44.96 error Command failed with exit code 1.
44.96 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
Dockerfile:61
--------------------
  59 |     # ENV REACT_APP_CONFIG=config/default.js
  60 |
  61 | >>> RUN yarn run build
  62 |
  63 |     # Stage 3: Bundle the built application into a Docker container
--------------------
ERROR: failed to solve: process "/bin/sh -c yarn run build" did not complete successfully: exit code: 1

View build details: docker-desktop://dashboard/build/default/default/g3vbyke2uro0kp7v0hbs3gvrl

Steps to Reproduce

docker build . -t ohif

The current behavior

Failing at yarn run build

The expected behavior

Should build an image

OS

Windows 11

Node version

20

Browser

Latest Chrome and edge

@highoncarbs highoncarbs added the Awaiting Reproduction Can we reproduce the reported bug? label May 24, 2024
@sedghi
Copy link
Member

sedghi commented May 24, 2024

I'm really surprised, since we build each beta release and push it to dockerhub

@highoncarbs
Copy link
Author

@sedghi I know, this is super weird, even tried cloning multiple times and checking. The local builds just fine. Any idea ? Also it would be helpful if you could help in my other issue as well.

@highoncarbs
Copy link
Author

@sedghi this is happening with the master branch, and 3.9 I guess where these two files were committed. on 3.5 it works fine

@eriklofblad
Copy link

I had the same issue when trying to build it with Docker on a Windows 11 machine but it works just fine when building with docker in linux. I solved it by changing the import statement for ProgressDropdownWithService from this:
import ProgressDropdownWithService from './components/ProgressDropdownWithService';
to this:
import ProgressDropdownWithService from './Components/ProgressDropdownWithService';
in the files /extensions/default/src/getToolbarModule.tsx and /extensions/default/src/getCustomizationModule.tsx

Is it perhaps case sensitive when running in Windows?

@highoncarbs
Copy link
Author

I figured these must have been due to windows @eriklofblad thanks! Also do you happen to share some insights on this as well Issue 4161 , would appreciate it.

@sedghi
Copy link
Member

sedghi commented May 27, 2024

I'm revisiting Docker builds, Nginx, and Keycloak stuff this week.

@sedghi sedghi self-assigned this May 29, 2024
@ctpaep
Copy link

ctpaep commented May 29, 2024

@sedghi Hi
could this be due to the fact that there are two folders in the /src directory: Components and components? I took a screenshot of your repository for clarity.
баг

@sedghi
Copy link
Member

sedghi commented May 30, 2024

@ctpaep Good catch, i'm fixing it in a minute

@sedghi
Copy link
Member

sedghi commented May 30, 2024

This will fix it , sorry #4192

@sedghi sedghi added fixed-in-dev-await-release This issue is fixed in master (viewer-dev) but we are pending testing for release (viewer.ohif.org) and removed Awaiting Reproduction Can we reproduce the reported bug? labels May 30, 2024
@yairroze
Copy link

I had the same issue when trying to build it with Docker on a Windows 11 machine but it works just fine when building with docker in linux. I solved it by changing the import statement for ProgressDropdownWithService from this: import ProgressDropdownWithService from './components/ProgressDropdownWithService'; to this: import ProgressDropdownWithService from './Components/ProgressDropdownWithService'; in the files /extensions/default/src/getToolbarModule.tsx and /extensions/default/src/getCustomizationModule.tsx

Is it perhaps case sensitive when running in Windows?

I see the same issue with tag v3.8.0 and Mac.
I also had to update this file Viewers/extensions/default/src/getCustomizationModule.tsx to fix the docker build issue.

95.72 @ohif/app: ERROR in ../../../extensions/default/src/getCustomizationModule.tsx 3:0-83
95.72 @ohif/app: Module not found: Error: Can't resolve './components/ProgressDropdownWithService' in '/usr/src/app/extensions/default/src'
95.72 @ohif/app: Did you miss the leading dot in 'resolve.extensions'? Did you mean '[".js",".jsx",".json",".ts",".tsx",".*"]' instead of '[".js",".jsx",".json",".ts",".tsx","*"]'?
95.72 @ohif/app: resolve './components/ProgressDropdownWithService' in '/usr/src/app/extensions/default/src'
95.72 @ohif/app:   using description file: /usr/src/app/extensions/default/package.json (relative path: ./src)
95.72 @ohif/app:     Field 'browser' doesn't contain a valid alias configuration
95.72 @ohif/app:     using description file: /usr/src/app/extensions/default/package.json (relative path: ./src/components/ProgressDropdownWithService)
95.72 @ohif/app:       no extension
95.72 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
95.72 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService doesn't exist
95.72 @ohif/app:       .js
95.72 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
95.72 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.js doesn't exist
95.72 @ohif/app:       .jsx
95.72 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
95.72 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.jsx doesn't exist
95.72 @ohif/app:       .json
95.72 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
95.72 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.json doesn't exist
95.72 @ohif/app:       .ts
95.72 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
95.72 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.ts doesn't exist
95.72 @ohif/app:       .tsx
95.72 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
95.72 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService.tsx doesn't exist
95.72 @ohif/app:       *
95.72 @ohif/app:         Field 'browser' doesn't contain a valid alias configuration
95.72 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService* doesn't exist
95.72 @ohif/app:       as directory
95.72 @ohif/app:         /usr/src/app/extensions/default/src/components/ProgressDropdownWithService doesn't exist
95.72 @ohif/app:  @ ../../../extensions/default/src/index.ts 9:0-62 42:2-24
95.72 @ohif/app:  @ ./pluginImports.js
95.72 @ohif/app:  @ ./index.js 19:0-89 33:4-21 34:4-16
95.72 @ohif/app: webpack 5.91.0 compiled with 1 error and 1 warning in 84682 ms (a7049b4172118429b0e6)

@sedghi
Copy link
Member

sedghi commented May 30, 2024

@yairroze check master it is fiex now

@linear linear bot changed the title [Bug] Docker Build failing at yarn run build [Bug] Docker Build failing at yarn run build Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-in-dev-await-release This issue is fixed in master (viewer-dev) but we are pending testing for release (viewer.ohif.org)
Projects
None yet
Development

No branches or pull requests

5 participants