-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular doesn't work with wasm web worker #25843
Comments
This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via This might be related to your directory structure so its really important to get an accurate repro to diagnose this. |
Hello @alan-agius4 ! |
Hi @directcuteo, thanks for the reproduction. It seems that this caused by incompatibles with top level await, which the Angular CLI this purposely not enable as it is not supported by all bundlers like esbuild evanw/esbuild#253 (comment). It is also worth mentioned that by using a custom Webpack config we are moving away from the supported and recommended path. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
In my Angular 16 project, I want to use a library that provides some functionalities. These functionalities are very CPU intens, therefore they were build using Rust and OCaml and integrated using WebWorkers and WASM.
I am able to access the library successfully in a simple HTML + javascript + npm project but not in my Angular project.
It seems that the code that is delivered by the web worker is different than the original and it is accessing an inexistent function.
The error
Error location
I don't know why there is a _mainWorker function but that one is not found anywhere in the code (at compile time).
The file is grabbed at runtime as
blob
using http request.And here is that function's body in its original form(in the IDE)
It seems that on runtime this code is changed and it is changed in a wrong way -> it results in that error.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: