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

Correctly provide file locations for errors and warnings when using preprocessors #153

Merged
merged 9 commits into from
Sep 5, 2023

Conversation

EMH333
Copy link
Owner

@EMH333 EMH333 commented Dec 8, 2022

Uses Mozilla's source-map library to parse the sourcemaps from preprocessors to correctly return the error/warning location in the original file.

Fixes #83

@EMH333 EMH333 added this to the v1.0.0 milestone Jan 7, 2023
@EMH333
Copy link
Owner Author

EMH333 commented Mar 15, 2023

Could use https://github.com/jridgewell/trace-mapping which is smaller

@EMH333
Copy link
Owner Author

EMH333 commented Apr 29, 2023

Gonna hold off releasing this since it looks like Svelte is slowly moving towards a v4 release which will unbundle it's dependencies (one of which is @jridgewell/trace-mapping) so I can do this will effectively no overhead

@EMH333 EMH333 added the enhancement New feature or request label Apr 29, 2023
@EMH333 EMH333 force-pushed the preprocess-warning-location branch from 033f976 to 2979d6e Compare June 27, 2023 00:56
@EMH333 EMH333 added the Breaking Is or would require, a breaking change label Jun 27, 2023
@EMH333 EMH333 force-pushed the preprocess-warning-location branch 2 times, most recently from 358442f to 1a161cf Compare September 5, 2023 15:39
Adds dependency on source-map but results in better warning locations.
Still need to figure out way to deal with error messages
Fixes error location for svelte errors not in preprocessor code. If
the error is because of a preprocessor then it is either using the
original source and should be fine, or using the source from another
preprocessor in which case there isn't enough data to extract a valid
line location since the sourcemap won't have been returned yet
@EMH333 EMH333 merged commit 2e884f0 into main Sep 5, 2023
4 checks passed
@EMH333 EMH333 deleted the preprocess-warning-location branch September 5, 2023 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Is or would require, a breaking change enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

line numbers inaccurate
1 participant