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

an error occurs when first build with incremental is true, and can't get the build instance #2280

Closed
xiaoboost opened this issue May 30, 2022 · 1 comment · Fixed by #2816

Comments

@xiaoboost
Copy link

When I use build method with config incremental: true,such as:

const esbuild = require('esbuild');
const path = require('path');

async function main() {
  try {
    const instance = await esbuild.build({
      incremental: true,
      bundle: true,
      minify: false,
      watch: true,
      entryPoints: [path.join(__dirname, './index.ts')],
    });

    console.log(`重编译实例:${!!instance}`);
  } catch (e) {
    console.log(e);
  }
}

main();

If the first build occurs a error, for example, the code in index.ts

let let

I can't get result of esbuild.build, it will be into catch statement.

I think do not throw errors here and set errors to errors property of result, it can be better.

@susiwen8
Copy link
Contributor

I think it's better not throwing error under watch mode at first build.

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

Successfully merging a pull request may close this issue.

2 participants