purescript / purescript Public
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
Sourcemap generated with negative lines/columns #4034
Comments
If there's an issue in generated source maps, it should be apparent either in the source maps in |
In this case purs emits faulty maps. For example for Data.Lens.Internal.Re purs 0.13.8 emits this mapping: Which translates to
So in the last line it emits a negative column and line. Maybe some invalid source span gets passed to the source map generator. |
@kevinbarabash Had improved the correctness of sourcemaps and was only missing tests by the end. |
It happened with me when tried to debug the source code with VSCode: |
…script#3851) Fix null sourcemaps issue (purescript#4034) Add tests
…ript#3851) Fix null mapping issue (purescript#4034) Add tests
…ript#3851) Fix null mapping issue (purescript#4034) Add tests
…ript#3851) Fix null mapping issue (purescript#4034) Add tests
* Improve mappings for expressions and binders (purescript#3851) * Add mapping for module imports * Fix null mapping issue (purescript#4034) * Add tests
* Improve mappings for expressions and binders (purescript#3851) * Add mapping for module imports * Fix null mapping issue (purescript#4034) * Clean up JS.hs * Add tests
* Fix null mapping issue (#4034) * Verify that each source map test produces a valid source map file
Description
I think there is some problem with sourcemaps generation, in that it produces lines/columns with negative indexes. I'm not 100% sure because I'm not an expert in the sourcemaps format, but I've got errors from webpack+purs-loader and using the source-map npm package, which makes me believe they are indeed incorrect.
To Reproduce
I'll give the steps I've used under Windows 10, but there shouldn't be any difference in other environments
Expected behavior
It should print a list of mappings between Effect.Console's purescript sources and generated javascript sources. Instead, it fails with an error:
Additional context
Spago version: 0.19.1
source-map package version: 0.7.3
psc: psc-0.14.0-20210318
PureScript version
0.14.0
The text was updated successfully, but these errors were encountered: