opencascade.js icon indicating copy to clipboard operation
opencascade.js copied to clipboard

Multi-Threaded build in Vite

Open Ruud-DRS opened this issue 6 months ago • 0 comments

When trying to load a custom made Multi-Threaded build in Vite in a worker, I'm getting the following error. Refused to execute script from '<URL>' because its MIME type ('application/wasm') is not executable.

I'm loading it like this:

import mainJs from './customBuild.multi-threaded.no-exceptions.progress-indicator'
import mainWasm from './customBuild.multi-threaded.no-exceptions.progress-indicator.wasm?url'
import worker from './customBuild.multi-threaded.no-exceptions.progress-indicator.worker.js?worker'
mainJs({
  locateFile: () => mainWasm,
  worker: worker
}).then((o) => {
  oc = o
  console.timeEnd('Loading OpenCascade.js')
  postMessage({ messageType: 'INITIALIZED' })
})

Could anyone point me in the right direction?

Ruud-DRS avatar Jun 20 '25 09:06 Ruud-DRS