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

Builds fail silently #185

Open
nothingrandom opened this issue Oct 6, 2023 · 3 comments
Open

Builds fail silently #185

nothingrandom opened this issue Oct 6, 2023 · 3 comments

Comments

@nothingrandom
Copy link

If there is a path error (eg change a directory name in a clean build) or a Typescript error running npm run build will fail, completely silently, with a success code.

Meanwhile, npm run start will provide some form of erroring.

Would be really useful (basically essential) for pipelines to start getting build to error properly and provide exit 1

@Romstar
Copy link

Romstar commented Oct 18, 2023

I have this issue as well. It happens with TypeScript, not sure if it happens with JSX as well.

@Romstar
Copy link

Romstar commented Oct 18, 2023

here is the link in webpack's docs. Apparently the err object does not contain the error so this repo needs to be updated.

webpack(config, (err, stats) => {
  if (err || stats.hasErrors()) {
    console.log('stats:', stats.toString({ colors: true }));
    // ...
  }
  // Done processing
});

https://webpack.js.org/api/node/#:~:text=The%20err%20object%20will%20not%20include%20compilation%20errors.%20Those%20must%20be%20handled%20separately%20using%20stats.hasErrors()%2C%20which%20will%20be%20covered%20in%20detail%20in%20the%20Error%20Handling%20section%20of%20this%20guide.%20The%20err%20object%20will%20only%20contain%20webpack%2Drelated%20issues%2C%20such%20as%20misconfiguration%2C%20etc.

@Romstar
Copy link

Romstar commented Oct 18, 2023

Created a PR above, hopefully he approves of it. There is an attached screenshot for the failed build error.

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

2 participants