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

Throwing an error within a plugin does not stop the build #3752

Open
JoaquinFernandez opened this issue May 6, 2024 · 0 comments
Open

Throwing an error within a plugin does not stop the build #3752

JoaquinFernandez opened this issue May 6, 2024 · 0 comments

Comments

@JoaquinFernandez
Copy link

Details

When creating a plugin, throwing an error inside it won't stop the build, it will just cause it to timeout.

How to reproduce

I didn't know how to create a repro on the playground for a plugin, so I am pasting the code of the plugin here:

import { Plugin, PluginBuild } from 'esbuild';

export const moduleExportsPlugin = (): Plugin => ({
  name: 'module-exports',
  setup(build: PluginBuild) {
    build.onEnd(_result => {
      throw new Error('module.exports already exists, unknown use case');
    });
  },
});

Versions

It seems a regression, in v0.16.x It worked fine, since 0.17.x it causes the unexpected behaviour

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