Coder Social home page Coder Social logo

mifi / stacktracify Goto Github PK

View Code? Open in Web Editor NEW
122.0 3.0 12.0 34 KB

CLI to make unreadable production stack traces readable using source maps

License: MIT License

JavaScript 100.00%
utility stacktrace parse minification sourcemaps cli javascript nodejs

stacktracify's Introduction

stacktracify

Have you ever been faced with a stacktrace that looks like this?

TypeError h is not a function. (In 'h()', 'h' is undefined) 
    main.jsbundle:954:5353 
    main.jsbundle:112:423 p
    main.jsbundle:112:1740 
    main.jsbundle:112:423 p
    main.jsbundle:112:898 n
    main.jsbundle:112:1273 
    main.jsbundle:50:205 c
    main.jsbundle:50:1623 b
    main.jsbundle:50:488 _
    [native code] value
    [native code] value

...perhaps from production from a minified web JS bundle or a React Native error report.

stacktracify takes a source map and a stack trace from your clipboard (or from a file) and outputs a readable stacktrace with proper line numbers for each line

Example output:

TypeError h is not a function. (In 'h()', 'h' is undefined) 
    at getAuthToken (logic/api.js:67:20)
    at authRequest (logic/api.js:127:8)
    at data (logic/SaveQueue.js:30:20)
    at op (logic/SaveQueue.js:43:29)
    at __callImmediates (node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:143:11)

Install

npm install -g stacktracify

Usage

Copy a minified stacktrace to your clipboard - then run:

stacktracify /path/to/js.map

Can also read stacktrace from file. For more info:

stacktracify --help

See also

stacktracify's People

Contributors

brandonnoad avatar dependabot[bot] avatar mifi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

stacktracify's Issues

Support multiple file sourcemaps

It would be very useful if you could provide a folder of sourcemaps, that way you don't have to run the command for each file in chunked build scenarios.

Support invoking from code

I need something very similar, but to use in javascript/typescript itself.

Scenario: I have a serverside express API, with an endpoint that logs errors from frontend (/api/log/). I send a JSON-string of the whole error-object to this endpoint. I would like the express server to "stacktracify" the error.stack and error.componentStack, before logging it further.

If this sounds like a good idea, I could try help get that kind of functionality into this repo, instead of creating yet another repo/application that demystifies stack traces?

(I guess it would involve making a different "bin"-file for the current functionality, and esm-export a function from the index-file. Or change "main" from index.js to another file exporting the core functionality.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.