Skip to content
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

[plugin-terser] The worker approach to running Terser breaks many valid Terser options #1781

Open
justinfagnani opened this issue Oct 3, 2024 · 0 comments

Comments

@justinfagnani
Copy link

Expected Behavior

All valid Terser options are supported. For this reproduction, the Terser nth_identifier option works.

Actual Behavior

An exception during build because only some of the code for the nth_identifier option is serialized. Other things seem to break from serializing the options, like nameCache updates.

Additional Information

The offending line that shows up in stack traces is here:

const options = eval2(`(${data.options})`);

But, the technique of taking options in one realm and serializing them to another, like a worker, is just not generally workable. Not all Terser options will be serializable. Functions are an obvious case, but I've had other cases of objects with prototypes, etc., breaking too.

@justinfagnani justinfagnani changed the title [plugin-terser] The worker approach to running Terse breaks many valid Terser options [plugin-terser] The worker approach to running Terser breaks many valid Terser options Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant