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

[Bug]: esbuild gets into infinite loop when using plugins #210

Open
TvdW opened this issue May 16, 2024 · 0 comments
Open

[Bug]: esbuild gets into infinite loop when using plugins #210

TvdW opened this issue May 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@TvdW
Copy link

TvdW commented May 16, 2024

What happened?

When using the esbuild module to build something that contains plugins, the sandbox plugin ends up in an infinite recursion. It keeps going until it eventually runs out of memory.

Version

osx, bazel 7.2.0rc1, rules_esbuild from git

How to reproduce

The bug was introduced by #160 / e39ac34

I am able to reproduce it with this minimal esbuild config:

const stylePlugin = require('esbuild-style-plugin');

module.exports = {
  plugins: [
    stylePlugin({}),
  ],
}

Any other information?

This happens because the sandbox sets otherOptions.pluginData.executedSandboxPlugin and expects it to be passed back, however if esbuild has other plugins defined it is not guaranteed that the other plugin will pass it otherOptions again (as this is not required by the esbuild plugin specification).

I've tried to fix it but without much luck (I'm not a js dev). Disabling the sandbox solves the problem but it's obviously not ideal 😄

@TvdW TvdW added the bug Something isn't working label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant