Skip to content

The basic demo doesn't work. #127

@szhu

Description

@szhu

I'm following the basic demo here:
https://github.com/evanw/node-source-map-support#basic-demo

npm install source-map-support

echo 'throw new Error("test"); // This is the original code' > original.js

echo 'require("source-map-support").install();

throw new Error("test"); // This is the compiled code
// The next line defines the sourceMapping.
//# sourceMappingURL=compiled.js.map' > compiled.js

echo '{
  "version": 3,
  "file": "compiled.js",
  "sources": ["original.js"],
  "names": [],
  "mappings": ";;;AAAA,MAAM,IAAI"
}' > compiled.js.map

node compiled.js

And I get:

.../compiled.js:3
throw new Error(test); // This is the compiled code
      ^
Error: test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions