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

Include standard webpack start/end locations in emitted errors #1255

Merged
merged 1 commit into from Feb 10, 2021

Conversation

lorenzodallavecchia
Copy link
Contributor

This PR adds the loc property to all errors coming from TypeScript diagnostics.
The property is the webpack "API" way of indicating the precise location of an error, including its end location.
In this way, the errors produced by ts-loader can be processed from the webpack Stats object, with no knowledge of ts-loader.

The previous location property is still available, so the change is backward-compatible.

Webpack will print its own error location string in the string output, in addition to the line and character that ts-loader already includes in the error message. All comparison tests are updated to expect the new output.

Closes #1199

@johnnyreilly
Copy link
Member

This looks good - thanks for contributing!

Could you update the package.json and the CHANGELOG.md please? I'll do another review later, but I think this is probably good to ship.

@lorenzodallavecchia
Copy link
Contributor Author

Could you update the package.json and the CHANGELOG.md please?

Done!

@johnnyreilly
Copy link
Member

Keep getting a failing test.. rerunning

@lorenzodallavecchia
Copy link
Contributor Author

lorenzodallavecchia commented Feb 10, 2021

@johnnyreilly yeash, I was thinking it was a known problem with the Travis setup.
By looking at the details it seems that the comparison tests on Ubuntu are being aborted after 15 minutes. Maybe they are taking too much time? On Windows the complete after 20 minutes.

@johnnyreilly
Copy link
Member

Passing now - go figure

@johnnyreilly johnnyreilly merged commit e9c2677 into TypeStrong:master Feb 10, 2021
@johnnyreilly
Copy link
Member

johnnyreilly commented Feb 10, 2021

https://github.com/TypeStrong/ts-loader/releases/tag/v8.0.17 - released!

Thanks for contributing 🌻❤️

@lorenzodallavecchia lorenzodallavecchia deleted the bug/error-loc branch February 11, 2021 11:50
This was referenced Mar 11, 2021
This was referenced Mar 14, 2021
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 this pull request may close these issues.

Errors/warnings added by ts-loader do not respect webpack API
2 participants