Closed lijiayi0921 closed 5 months ago
You need to copy the public assets from @itwin/core-frontend. #6591
Thank you @pmconne, but I didn't fully understand. Do you mean to copy all subdirs of @itwin/core-frontend/lib/public (assets, cursor, scripts, ...) into my frontend's public folder ? Just tried and this did'nt solve my problem.
Also what's the reason of copying them? They don't appear in the public folder of the sample app : https://developer.bentley.com/tutorials/web-application-quick-start/
---------------- Edit ------------------- Instead of the public folder, I copied them into public/viewer/itwin based on my error. The models loads again !
Loading Worker from “[http://localhost:3001/viewer/itwin/scripts/parse-imdl-worker.js”]
(http://localhost:3001/viewer/itwin/scripts/parse-imdl-worker.js%E2%80%9D) was blocked because of a disallowed MIME type (“text/html”).
However I still don't understand why this is a necessity. Why it was not required in my previous implementation (4.0.*), and in the sample app ?
Why it was not required in my previous implementation (4.0.*), and in the sample app ?
The worker script was introduced in 4.2.0.
Presumably the viewer package sets IModelApp.publicPath to "viewer/itwin".
Thank you @pmconne for your help & explanation !
Hi,
I upgraded my https://github.com/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 :
With Chrome this error :
Below is my implementation :
Any help will be appreciated ! Thank you
Jiayi