iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
623 stars 211 forks source link

Uncaught SyntaxError SyntaxError: Unexpected token '<' from "parse-imdl-worker.js" #6591

Closed VietBuiHa closed 8 months ago

VietBuiHa commented 8 months ago

Hello guys,

I'm migrating an existing iTwinjs v3 app into v4 due to its end of support somewhere in May, the migration process came smoothly and the application working as expected until I tried to open an iModel from iModelHub, the data seemed to load but nothing was visualized and an exception was throw (see attached bellow). *Reality model tile can be loaded successfully, the problem only happens with iModelTile

Thanks,

Uncaught SyntaxError SyntaxError: Unexpected token '<' --- Worker Created --- at createWorkerProxy (\node_modules\@itwin\core-frontend\src\common\WorkerProxy.ts:105:14) at acquireImdlParser (\node_modules\@itwin\core-frontend\src\tile\ImdlParser.ts:54:22) at acquireImdlDecoder (\node_modules\@itwin\core-frontend\src\tile\ImdlDecoder.ts:67:18) at IModelTileTree (\node_modules\@itwin\core-frontend\src\tile\IModelTileTree.ts:383:20) at createTileTree (\node_modules\@itwin\core-frontend\src\tile\PrimaryTileTree.ts:77:14) --- await --- at _load (\node_modules\@itwin\core-frontend\src\Tiles.ts:55:35) at load (\node_modules\@itwin\core-frontend\src\Tiles.ts:33:10) at createDrawArgs (\node_modules\@itwin\core-frontend\src\tile\TileTreeReference.ts:152:33) at createDrawArgs (\node_modules\@itwin\core-frontend\src\tile\PrimaryTileTree.ts:209:24) at addToScene (\node_modules\@itwin\core-frontend\src\tile\TileTreeReference.ts:67:23) at <anonymous> (\node_modules\@itwin\core-frontend\src\ViewState.ts:554:61) at forEachModelTreeRef (\node_modules\@itwin\core-frontend\src\SpatialViewState.ts:224:7) at forEachTileTreeRef (\node_modules\@itwin\core-frontend\src\ViewState.ts:508:10) at createScene (\node_modules\@itwin\core-frontend\src\ViewState.ts:554:10) at createScene (\node_modules\@itwin\core-frontend\src\SpatialViewState.ts:229:11) at createScene (\node_modules\@itwin\core-frontend\src\Viewport.ts:2411:15) at renderFrame (\node_modules\@itwin\core-frontend\src\Viewport.ts:2511:14) at renderLoop (\node_modules\@itwin\core-frontend\src\ViewManager.ts:412:10) at eventLoop (\node_modules\@itwin\core-frontend\src\IModelApp.ts:536:29) at <anonymous> (\node_modules\@itwin\core-frontend\src\IModelApp.ts:491:45) --- requestAnimationFrame --- at requestNextAnimation (\node_modules\@itwin\core-frontend\src\IModelApp.ts:491:7) at invalidateDecorations (\node_modules\@itwin\core-frontend\src\Viewport.ts:383:15) at <anonymous> (\node_modules\@itwin\core-frontend\src\ViewState.ts:2276:80) at setSky (\node_modules\@itwin\core-frontend\src\EnvironmentDecorations.ts:193:10) at loadSkyBox (\node_modules\@itwin\core-frontend\src\EnvironmentDecorations.ts:175:12) at EnvironmentDecorations (\node_modules\@itwin\core-frontend\src\EnvironmentDecorations.ts:56:10) at attachToViewport (\node_modules\@itwin\core-frontend\src\ViewState.ts:2276:36) at attachToViewport (\node_modules\@itwin\core-frontend\src\SpatialViewState.ts:236:11) at attachToView (\node_modules\@itwin\core-frontend\src\Viewport.ts:1161:15) at setView (\node_modules\@itwin\core-frontend\src\Viewport.ts:1150:10) at doSetupFromView (\node_modules\@itwin\core-frontend\src\Viewport.ts:1903:10) at changeView (\node_modules\@itwin\core-frontend\src\Viewport.ts:1735:10) at changeView (\node_modules\@itwin\core-frontend\src\Viewport.ts:3438:11) at create (\node_modules\@itwin\core-frontend\src\Viewport.ts:3031:8) at getScreenViewport (\node_modules\@itwin\imodel-components-react\src\imodel-components-react\viewport\ViewportComponent.tsx:272:50) at <anonymous> (\node_modules\@itwin\imodel-components-react\src\imodel-components-react\viewport\ViewportComponent.tsx:351:32) at invokePassiveEffectCreate (\node_modules\react-dom\cjs\react-dom.development.js:23487:20) at callCallback2 (\node_modules\react-dom\cjs\react-dom.development.js:3945:14) at invokeGuardedCallbackDev (\node_modules\react-dom\cjs\react-dom.development.js:3994:16) at invokeGuardedCallback (\node_modules\react-dom\cjs\react-dom.development.js:4056:31) at flushPassiveEffectsImpl (\node_modules\react-dom\cjs\react-dom.development.js:23574:9) at unstable_runWithPriority (\node_modules\scheduler\cjs\scheduler.development.js:468:12) at runWithPriority$1 (\node_modules\react-dom\cjs\react-dom.development.js:11276:10) at flushPassiveEffects (\node_modules\react-dom\cjs\react-dom.development.js:23447:14) at performSyncWorkOnRoot (\node_modules\react-dom\cjs\react-dom.development.js:22269:3) at <anonymous> (\node_modules\react-dom\cjs\react-dom.development.js:11327:26) at unstable_runWithPriority (\node_modules\scheduler\cjs\scheduler.development.js:468:12) at runWithPriority$1 (\node_modules\react-dom\cjs\react-dom.development.js:11276:10) at flushSyncCallbackQueueImpl (\node_modules\react-dom\cjs\react-dom.development.js:11322:9) at flushSyncCallbackQueue (\node_modules\react-dom\cjs\react-dom.development.js:11309:3) at scheduleUpdateOnFiber (\node_modules\react-dom\cjs\react-dom.development.js:21893:9) at dispatchAction (\node_modules\react-dom\cjs\react-dom.development.js:16139:5) at <anonymous> (\node_modules\@itwin\appui-react\src\appui-react\frontstage\FrontstageDef.tsx:1090:9) at raiseEvent (\node_modules\@itwin\core-bentley\src\BeEvent.ts:101:28) at emit (\node_modules\@itwin\core-bentley\src\BeEvent.ts:141:46) at setActiveFrontstageDef (\node_modules\@itwin\appui-react\src\appui-react\frontstage\InternalFrontstageManager.ts:461:60) --- await --- at <anonymous> (\node_modules\@itwin\viewer-react\src\components\iModel\IModelViewer.tsx:39:36) at invokePassiveEffectCreate (\node_modules\react-dom\cjs\react-dom.development.js:23487:20) at callCallback2 (\node_modules\react-dom\cjs\react-dom.development.js:3945:14) at invokeGuardedCallbackDev (\node_modules\react-dom\cjs\react-dom.development.js:3994:16) at invokeGuardedCallback (\node_modules\react-dom\cjs\react-dom.development.js:4056:31) at flushPassiveEffectsImpl (\node_modules\react-dom\cjs\react-dom.development.js:23574:9) at unstable_runWithPriority (\node_modules\scheduler\cjs\scheduler.development.js:468:12) at runWithPriority$1 (\node_modules\react-dom\cjs\react-dom.development.js:11276:10) at flushPassiveEffects (\node_modules\react-dom\cjs\react-dom.development.js:23447:14) at performSyncWorkOnRoot (\node_modules\react-dom\cjs\react-dom.development.js:22269:3) at <anonymous> (\node_modules\react-dom\cjs\react-dom.development.js:11327:26) at unstable_runWithPriority (\node_modules\scheduler\cjs\scheduler.development.js:468:12) at runWithPriority$1 (\node_modules\react-dom\cjs\react-dom.development.js:11276:10) at flushSyncCallbackQueueImpl (\node_modules\react-dom\cjs\react-dom.development.js:11322:9) at flushSyncCallbackQueue (\node_modules\react-dom\cjs\react-dom.development.js:11309:3) at scheduleUpdateOnFiber (\node_modules\react-dom\cjs\react-dom.development.js:21893:9) at dispatchAction (\node_modules\react-dom\cjs\react-dom.development.js:16139:5) at <anonymous> (\node_modules\@itwin\viewer-react\src\components\iModel\IModelViewer.tsx:59:13) --- Promise.then --- at <anonymous> (\node_modules\@itwin\viewer-react\src\components\iModel\IModelViewer.tsx:57:10) at invokePassiveEffectCreate (\node_modules\react-dom\cjs\react-dom.development.js:23487:20) at callCallback2 (\node_modules\react-dom\cjs\react-dom.development.js:3945:14) at invokeGuardedCallbackDev (\node_modules\react-dom\cjs\react-dom.development.js:3994:16) at invokeGuardedCallback (\node_modules\react-dom\cjs\react-dom.development.js:4056:31) at flushPassiveEffectsImpl (\node_modules\react-dom\cjs\react-dom.development.js:23574:9) at unstable_runWithPriority (\node_modules\scheduler\cjs\scheduler.development.js:468:12) at runWithPriority$1 (\node_modules\react-dom\cjs\react-dom.development.js:11276:10) at flushPassiveEffects (\node_modules\react-dom\cjs\react-dom.development.js:23447:14) at performSyncWorkOnRoot (\node_modules\react-dom\cjs\react-dom.development.js:22269:3) at <anonymous> (\node_modules\react-dom\cjs\react-dom.development.js:11327:26) at unstable_runWithPriority (\node_modules\scheduler\cjs\scheduler.development.js:468:12) at runWithPriority$1 (\node_modules\react-dom\cjs\react-dom.development.js:11276:10) at flushSyncCallbackQueueImpl (\node_modules\react-dom\cjs\react-dom.development.js:11322:9) at flushSyncCallbackQueue (\node_modules\react-dom\cjs\react-dom.development.js:11309:3) at scheduleUpdateOnFiber (\node_modules\react-dom\cjs\react-dom.development.js:21893:9) at dispatchAction (\node_modules\react-dom\cjs\react-dom.development.js:16139:5) at <anonymous> (\node_modules\@itwin\viewer-react\src\components\iModel\IModelLoader.tsx:138:7) --- await --- at <anonymous> (\node_modules\@itwin\viewer-react\src\components\iModel\IModelLoader.tsx:157:10) at invokePassiveEffectCreate (\node_modules\react-dom\cjs\react-dom.development.js:23487:20) at callCallback2 (\node_modules\react-dom\cjs\react-dom.development.js:3945:14) at invokeGuardedCallbackDev (\node_modules\react-dom\cjs\react-dom.development.js:3994:16) at invokeGuardedCallback (\node_modules\react-dom\cjs\react-dom.development.js:4056:31) at flushPassiveEffectsImpl (\node_modules\react-dom\cjs\react-dom.development.js:23574:9) at unstable_runWithPriority (\node_modules\scheduler\cjs\scheduler.development.js:468:12) at runWithPriority$1 (\node_modules\react-dom\cjs\react-dom.development.js:11276:10) at flushPassiveEffects (\node_modules\react-dom\cjs\react-dom.development.js:23447:14) at <anonymous> (\node_modules\react-dom\cjs\react-dom.development.js:23324:11) at workLoop (\node_modules\scheduler\cjs\scheduler.development.js:417:34) at flushWork (\node_modules\scheduler\cjs\scheduler.development.js:390:14) at performWorkUntilDeadline (\node_modules\scheduler\cjs\scheduler.development.js:157:27)

VietBuiHa commented 8 months ago

Sorry guys, silly me :) I forgot to copy new public files from the lib folder into my public folder, the real issue is "parse-imdl-worker.js" is missing.