iTwin / viewer

Monorepo that contains the iTwin Viewer npm packages and their related packages
MIT License
25 stars 16 forks source link

Model not loading since upgraded from 4.0.* #315

Closed lijiayi0921 closed 4 months ago

lijiayi0921 commented 4 months ago

Hi, I upgraded my @itwin packages to latest version (4.6.0 as of today), from @itwin/web-viewer-react@4.0.3 and most of the rest 4.0.2. With the same frontend code, the viewer no longer loads the imodel. The sign-in, as well as the display of all widgets are working. Custom 3D sprites are loaded, only the imodel is missing.

With Firefox i'm getting this error : Loading Worker from “http://localhost:3001/viewer/itwin/scripts/parse-imdl-worker.js” was blocked because of a disallowed MIME type (“text/html”).

With Chrome this error : Uncaught SyntaxError: Unexpected token '<' at handleError (http://localhost:3001/static/js/bundle.js:774837:58) at http://localhost:3001/static/js/bundle.js:774856:7

Below is my implementation :

 {isLoggedIn || redirectUrl.pathname !== window.location.pathname ?

(<Viewer key={'viewer'} iTwinId={props.file?.platformBucket} iModelId={props.file?.platformModel!} authClient={authClient} onIModelAppInit={onIModelAppInit} onIModelConnected={onIModelConnected} additionalI18nNamespaces={['safe', 'safeTools']} uiProviders={[ new ViewerNavigationToolsProvider(), new ViewerContentToolsProvider({ vertical: { measureGroup: false, }, }), new ViewerStatusbarItemsProvider(), new TreeWidgetUiItemsProvider(), new PropertyGridUiItemsProvider(), new MeasureToolsUiItemsProvider(), ...(safeExt?.uiProviders ?? []) ]} viewCreatorOptions={viewCreatorOptions} enablePerformanceMonitors={true} /> ) : null}

Any help will be appreciated !

Jiayi

lijiayi0921 commented 4 months ago

Closed as reposted on itwinjs-core https://github.com/iTwin/itwinjs-core/issues/6763