nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

option to set location for sourcemaps (for console logs)

Open farfromrefug opened this issue 5 years ago • 12 comments

Ok so to get sourcemaps fully working with Sentry, i have to modify quite a few things:

  • change the location of sourcemaps (like with hidden sourcemaps)
  • force sourceMappingURL to follow the format app:///bundle.js.map (so no mention to the relative path where source maps are located).

Consequently sourceMapConverter will fail here because this is the wrong location. I guess it tries to find the sourcemap in the same dir as the source itself. Or even what does it do with app:///

Do you think it would be possible to define somewhere (project wise) the location of the sourcemaps. May be using https://github.com/thlorenz/convert-source-map#frommapfilecommentcomment-mapfiledir ?

farfromrefug avatar Jan 28 '20 13:01 farfromrefug

Hey @farfromrefug , In case the parsing of the source map fails (which probably happens in your scenario), the thing that will not be as usual are the logs CLI shows, i.e. they will not point to the real files, but instead will have stacktrace from bundle.js, vendor.js, etc. Is this the issue you want to resolve with this feature request or something else is not working on your side?

rosen-vladimirov avatar Feb 19 '20 08:02 rosen-vladimirov

@rosen-vladimirov yes sorry for not being clear enough. Indeed what is failing for me when using sentry is the cli logging and sourcemap use

farfromrefug avatar Feb 19 '20 08:02 farfromrefug

@farfromrefug I uploaded the sourceMap file to sentry put unfortunately it didn't work, is there a specific --url-prefix I should use while uploading the .map files?

bellalMohamed avatar Mar 01 '20 17:03 bellalMohamed

Yes use app:///

farfromrefug avatar Mar 01 '20 19:03 farfromrefug

@farfromrefug not working for me :(

bellalMohamed avatar Mar 10 '20 01:03 bellalMohamed

@bellalMohamed let s move that discussion to slack or discords. I am on both

farfromrefug avatar Mar 10 '20 08:03 farfromrefug

@bellalMohamed let s move that discussion to slack or discords. I am on both

NativeScript channel or private?

bellalMohamed avatar Mar 11 '20 14:03 bellalMohamed

whatever. Best to share it with others i guess

farfromrefug avatar Mar 11 '20 14:03 farfromrefug

@farfromrefug @bellalMohamed Did you get this working in the end?

vandammeb avatar Oct 27 '20 10:10 vandammeb

@vandammeb check this repo from @farfromrefug https://github.com/farfromrefug/ns-forecastie

bellalMohamed avatar Oct 27 '20 18:10 bellalMohamed

@bellalMohamed Can you help with envs in this repo) Can't do work it without SENTRY_PREFIX and SOURCEMAP_REL_DIR envs

Kolobok12309 avatar Apr 11 '21 09:04 Kolobok12309

@Kolobok12309 should ask that on Discord. You can find me there. I ll help

farfromrefug avatar Apr 11 '21 10:04 farfromrefug