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
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When a package contains a worker that is importing an external dependency in the worker script the worker will silently fail when called. An error event can be received when defining a callback for Worker.onerror but this isn't of much help. The issue only occurs with external dependencies (even if the dependency is unused). In the minimal reproduction example I am using comlink but the same happens when importing something from lodash. Importing local scripts is working fine though.
I have tried other major UI libraries like react, svelte and vue that have no problems with the any of the workers (despite the optimizeDeps issue with the vite bundler).
Problematic code:
import*asComlinkfrom'comlink';// even failing when not used further downconstobj={test(){console.log("hello");}}onmessage=(message)=>{console.log(message.data,"from worker with import");}Comlink.expose(obj);
Loading the worker script had to be achieved by setting these settings in the angular.json:
Otherwise I would be stuck with this issue: #28994
I don't know if this would lead to the error condition I am experiencing.
Minimal Reproduction
I have created a repository for reproducing the problem: https://github.com/varfoer/comlink_worker_issues
The worker packages is already build there, so you can go ahead and try npm i and npm start or npm run dev in the several folders for the different UI libraries.
The error occurs because the worker itself is not bundled, causing it to import a non-existent module. Although the error message isn't very clear, it originates from the browser.
Command
serve, build
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When a package contains a worker that is importing an external dependency in the worker script the worker will silently fail when called. An error event can be received when defining a callback for
Worker.onerror
but this isn't of much help. The issue only occurs with external dependencies (even if the dependency is unused). In the minimal reproduction example I am usingcomlink
but the same happens when importing something fromlodash
. Importing local scripts is working fine though.I have tried other major UI libraries like react, svelte and vue that have no problems with the any of the workers (despite the
optimizeDeps
issue with the vite bundler).Problematic code:
Loading the worker script had to be achieved by setting these settings in the
angular.json
:Otherwise I would be stuck with this issue: #28994
I don't know if this would lead to the error condition I am experiencing.
Minimal Reproduction
I have created a repository for reproducing the problem: https://github.com/varfoer/comlink_worker_issues
The worker packages is already build there, so you can go ahead and try
npm i
andnpm start
ornpm run dev
in the several folders for the different UI libraries.Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: