Skip to content

fix(@angular-devkit/build-angular): fix aot mode for web worker#19908

Closed
moczix wants to merge 1 commit into
angular:masterfrom
moczix:master
Closed

fix(@angular-devkit/build-angular): fix aot mode for web worker#19908
moczix wants to merge 1 commit into
angular:masterfrom
moczix:master

Conversation

@moczix
Copy link
Copy Markdown

@moczix moczix commented Jan 30, 2021

i setup angular app in web-worker to use angular DI powers. It all worked well until i build production build. I got error about something bootstrap of undefined. I started investigate angular sources, and found this code.
With aot flag set to false my angularApp inside web-worker with production build doesnt have ivy metadata like "emod".
Comparing this flag to other flags about aot i didnt find out why this flag is set to false. So i made if condition like other places

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Jan 30, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla Bot added the cla: no label Jan 30, 2021
@moczix
Copy link
Copy Markdown
Author

moczix commented Jan 30, 2021

@googlebot I signed it!

@moczix moczix changed the title Fix for using angular app inside web-worker in production build fix(@angular-devkit/build-angular): fix aot mode for web worker Feb 3, 2021
@moczix
Copy link
Copy Markdown
Author

moczix commented Feb 12, 2021

@alan-agius4 can you review? or set the target? or did i do something wrong here?

@alan-agius4
Copy link
Copy Markdown
Collaborator

Hi @moczix,

Thanks for your contribution, however this is the intended behaviour.

Can you please elaborate your use case a bit more to why you need Angular DI in a worker?

Thanks.

@moczix
Copy link
Copy Markdown
Author

moczix commented Jun 1, 2021

@alan-agius4 , i made app similar to your deprecated ui worker thread. But in my case i placed in worker only business logic, and it was cool to have angular DI in worker

@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Jul 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants