OHIF / Viewers

OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages
https://docs.ohif.org/
MIT License
3.35k stars 3.37k forks source link

[Bug] OHIF doesn't load for an app hosted at non-root path #4316

Closed mtesopt closed 3 days ago

mtesopt commented 3 months ago

Describe the Bug

I’m embedding OHIF V3.7 inside a React app via an iframe. When I run the application, the iframe is empty.

Steps to Reproduce

  1. I built the project,
  2. Copied the build artifacts (contents of the dist folder), and
  3. Placed them inside my React app’s public folder under /ohif

The React app is hosted at e.g. https://www.example.com/med/study-images routerBaseName is /med/study-images/ohif and PUBLIC_URL is /med/study-images/ohif/

I'm following the documentation from https://docs.ohif.org/deployment/custom-url-access

The current behavior

The iframe is empty.

In the network panel, I see the request to ohif/ succeed with a 200 but I don’t see subsequent calls to app-config, js bundles, and assets etc…

What is the correct configuration for routerBaseName and PUBLIC_URL when app is hosted at non-root path?

The expected behavior

OHIF loads & shows the study list

OS

Windows 10

Node version

18.20.3

Browser

Chrome v126

helghast79 commented 2 weeks ago

Hi!

Had similar issue. Try using PUBLIC_URL=/ohif/ in your build script (/platform/app/package.json) and routerBasename: '/ohif' in your config file (/platform/app/public/config/yourConfig.js)

hope it helps, cheers!