Git Product home page Git Product logo

sentry-node-sourcemap's Introduction

sentry-node-sourcemap

to bundle and minify, upload source and source map to sentry.io, start test code and create an error:

setup

create a .sentryclirc file with:

[defaults]
url=https://sentry.io/
org=XXXXXXXXXX
project=YYYYYY

[auth]
token=zzzzzzzzzzzzz

replace DSN with your version

export DSN=https://[email protected]/YYYYYYY

sentry.io release version

export SVERSION=release001

build application and upload sourcemaps to sentry.io

yarn build
yarn run v1.10.1
$ webpack && ./sentry-sourcemap-upload.sh
Hash: 86b45174740734569b72
Version: webpack 4.22.0
Time: 616ms
Built at: 22.10.2018 21:44:47
      Asset     Size  Chunks             Chunk Names
    main.js  274 KiB       0  [emitted]  main
main.js.map  333 KiB       0  [emitted]  main
Entrypoint main = main.js main.js.map
 [8] external "domain" 42 bytes {0} [built]
[21] external "fs" 42 bytes {0} [built]
[23] external "http" 42 bytes {0} [built]
[26] external "util" 42 bytes {0} [built]
[27] external "module" 42 bytes {0} [built]
[29] ./src/mindex.js 1.81 KiB {0} [built]
[52] external "https" 42 bytes {0} [built]
[55] external "console" 42 bytes {0} [built]
[59] external "os" 42 bytes {0} [built]
[60] external "url" 42 bytes {0} [built]
[65] external "path" 42 bytes {0} [built]
    + 56 hidden modules
Created release release017.
Finalized release release017.
> Analyzing 2 sources
> Rewriting sources
> Adding source map references
> Validating sources
> Uploading source maps for release release017

Source Map Upload Report
  Scripts
    ~/main.js
  Source Maps
    ~/main.js.map
+---------------+--------------+------------+----------+
| Name          | Distribution | Source Map | Size     |
+---------------+--------------+------------+----------+
| ~/main.js     |              |            | 273.98KB |
| ~/main.js.map |              |            | 332.66KB |
+---------------+--------------+------------+----------+

start the app and simulate an error

yarn start
yarn run v1.10.1
$ node dist/main.js
Release:  release017
ReferenceError: b is not defined
    at a (/usr/local/sentry-node/dist/main.js:3314:3)
    at Object.__assign (/usr/local/sentry-node/dist/main.js:3316:1)
    at __webpack_require__ (/usr/local/sentry-node/dist/main.js:20:30)
    at Object.defineProperty.value (/usr/local/sentry-node/dist/main.js:84:18)
    at Object.<anonymous> (/usr/local/sentry-node/dist/main.js:87:10)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
root:  /usr/local/sentry-node/dist/
filename changed: app:///main.js
filename changed: app:///main.js
filename changed: app:///main.js
filename changed: app:///main.js
filename changed: app:///main.js
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

peek into source map

yarn source-map-peek dist/main.js:3314:3
yarn run v1.10.1
$ source-map-peek dist/main.js:3314:3
Failed to open original source file from webpack:///src/mindex.js ENOENT
file: webpack:///src/mindex.js
line: 55 column: 0
✨  Done in 0.29s.

line: 55 should be the line with:

a = b / 0; // create an error

source map event on sentry.io

show original source

sentry-node-sourcemap's People

Contributors

aheissenberger avatar

Watchers

 avatar James Cloos avatar  avatar

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.