You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While following the Getting Started guide I failed to use the native worker support introduced with Webpack 5. Following the Webpack 4 approach of loading web workers using worker-loader works though.
My first attempt at a quick fix was to just create a new Worker instance by using the new operator (#1). This does not work since spectroplot-js itself tries to create instances of workerOrUrl:
🐞 Problem
While following the Getting Started guide I failed to use the native worker support introduced with Webpack 5. Following the Webpack 4 approach of loading web workers using
worker-loader
works though.🗒️ Steps to reproduce
The files at kerel-fs/spectranalysis@eb1e672 contain the example project of spectroplot-js, running fine while using
worker-loader
. Changing ./src/easy.js#L14 fromto
(as described in the README) will generate the following error on page load:
💡 Possible solutions
My first attempt at a quick fix was to just create a new
Worker
instance by using thenew
operator (#1). This does not work since spectroplot-js itself tries to create instances ofworkerOrUrl
:spectroplot-js/lib/spectroplot.js
Line 108 in 8117f58
Probably some adjustment is needed here for the native web worker support of Webpack 5, but I didn't come of with a working patch yet.
The text was updated successfully, but these errors were encountered: