fix: fix crash with postcss 8.5.16+ when resolving original token locations#321
Merged
Merged
Conversation
postcss 8.5.16 (postcss/postcss#2036) fixed `Input#origin()` to correctly accept 1-based columns. The `- 1` workaround in `getOriginalLocationOfClassSelector` is no longer needed and causes double subtraction, resulting in `column = -1` which crashes `source-map-js`. Fixes mizdra#320
c73b43a to
6e1f707
Compare
…alue postcss 8.5.16 (postcss/postcss#2036) changed `Input#origin()` to return 1-based columns as well as accept them. The `+ 1` conversion in `getOriginalLocationOfClassSelector` is no longer needed and shifted original locations by one column. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
|
Thanks for sending the PR! The changes looked good, but I have added a few commits here.
The tests are passing, so I will go ahead and merge this. |
Owner
|
This is shipped in https://github.com/mizdra/happy-css-modules/releases/tag/v5.0.2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
postcss 8.5.16 (postcss/postcss#2036) fixed
Input#origin()to correctly accept 1-based columns and internally convert to 0-based before passing tosource-map-js.The
- 1workaround ingetOriginalLocationOfClassSelectoris no longer needed and causes double subtraction, resulting incolumn = -1which crashessource-map-js:Fixes #320