Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented Dec 20, 2024

Node.js workers will currently fail to initialize if the execArgv option is used and it contains v8 specific options. This is currently problematic for the JS transformer worker because it contains a workaround to remove the SSR --import argument that is used to add a loader hook for SSR purposes. The filtering of the argument and subsequent use of the execArgv array had the potential to pass custom Node.js options to the worker and cause it to fail. These options can be passed by developers on the command line when invoking the Angular CLI.
To mitigate this problem, the execArgv option is now only filtered and used if the SSR import argument is present in the array. Otherwise, no value is passed which allows the default Node.js behavior to be used. While this does not fully solve the problem for all projects, it does remove the problem from non-SSR projects.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Dec 20, 2024
@clydin clydin force-pushed the application/js-transformer-execargs branch from f9f6fce to 3173a53 Compare December 20, 2024 01:24
Node.js workers will currently fail to initialize if the `execArgv` option
is used and it contains v8 specific options. This is currently problematic
for the JS transformer worker because it contains a workaround to remove the
SSR `--import` argument that is used to add a loader hook for SSR purposes.
The filtering of the argument and subsequent use of the `execArgv` array had
the potential to pass custom Node.js options to the worker and cause it to fail.
These options can be passed by developers on the command line when invoking the
Angular CLI.
To mitigate this problem, the `execArgv` option is now only filtered and used if the
SSR import argument is present in the array. Otherwise, no value is passed which
allows the default Node.js behavior to be used. While this does not fully solve the
problem for all projects, it does remove the problem from non-SSR projects.
@clydin clydin force-pushed the application/js-transformer-execargs branch from 3173a53 to c8b5f7f Compare December 20, 2024 01:25
@clydin clydin requested a review from alan-agius4 December 20, 2024 02:28
@clydin clydin added the action: merge The PR is ready for merge by the caretaker label Dec 20, 2024
@clydin clydin merged commit 5cc62d4 into angular:main Dec 20, 2024
31 checks passed
@clydin
Copy link
Member Author

clydin commented Dec 20, 2024

The changes were merged into the following branches: main, 19.0.x

@angular-automatic-lock-bot
Copy link

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 Jan 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants