https://github.com/martinklepsch/shadow-src-map-issues
https://github.com/martinklepsch/shadow-src-map-issues
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/martinklepsch/shadow-src-map-issues
- Owner: martinklepsch
- Created: 2020-06-04T14:02:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-10T21:25:28.000Z (almost 5 years ago)
- Last Synced: 2025-01-29T13:46:44.008Z (12 months ago)
- Language: Clojure
- Size: 93.8 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# shadow-src-map-issues
This repo tries to demonstrate an issue with broken source maps when using the `:node-library` target in Shadow-CLJS.
Two helper scripts are included to verify source mapping:
- `sourcemap.clj` looks up the locations of an error using `com.google.debugging.sourcemap.SourceMapConsumerV3` and returns the source file and line numbers as edn maps
- `view-source.clj` is a [babashka](https://github.com/borkdude/babashka) script that takes this information and prints the relevant lines for each file that is part of the project.
#### `:node-library` repro process
```
shadow-cljs release srcmaptest
```
```
node -e 'var x = require("./functions/index"); x.throw()' 2>&1 | ./sourcemap.clj | ./view-source.clj
```
#### `:node-script` repro process
**Note:** Without `--debug` this also doesn't work.
```
shadow-cljs release srcmaptestscript --debug
```
```
node script/index.js 2>&1 | ./sourcemap.clj | ./view-source.clj
```