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

Fix: Error location mismatches after loader processing #18260

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

log101
Copy link

@log101 log101 commented Mar 29, 2024

What kind of change does this PR introduce?

Fixes #12025

Updates error locations for modules processed by loaders. Previously, processing caused error locations to be mismatched with the original file. This PR solves this issue by updating error locations using source map information.

Did you add tests for your changes?

Yes, added a new stat test.

Does this PR introduce a breaking change?

This PR is not expected to introduce any breaking changes. It only effects error messages of modules with compilation errors.

What needs to be documented once your changes are merged?

This fix does not need to be documented. But it should be noted that loaders should also support source maps such as ts-loader for this fix to work.

Copy link

linux-foundation-easycla bot commented Mar 29, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@log101 log101 closed this Apr 3, 2024
@alexander-akait
Copy link
Member

Why closed? 😞

@log101
Copy link
Author

log101 commented Apr 4, 2024

Why closed? 😞

I was planning to add updateErrorLocation function to webpack-sources repo and then open this again after it got merged. Should I keep it open?

@log101 log101 reopened this Apr 4, 2024
@alexander-akait
Copy link
Member

@log101 got it, but let's keep it open until we resolve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong line numbers when processing files after ts-loader
3 participants