-
-
Notifications
You must be signed in to change notification settings - Fork 49
Enable debugging with source maps #603
Comments
Comparison of webpack performance without source maps, with inline-cheap-module-source-map, and with inline-source-map: Tests executed on https://github.com/NativeScript/nativescript-sdk-examples-ng and https://github.com/NativeScript/nativescript-sdk-examples-js apps and represent the "total" column (in seconds) from the |
Also [for typescript projects], it seems there is something different about how https://github.com/s-panferov/awesome-typescript-loader handles inline-source-map vs inline-cheap-module-source-map webpack devtool option (the former is automagically handled by the loader, while the latter isn't). This(?) results in a different folder structure generated for the webpack:// protocol. TypeScript project with inline-source-map: TypeScript project with inline-cheap-module-source-map: Ultimately this requires different inline-source-map:
inline-cheap-module-source-map:
|
I tried adding |
@IAMtheIAM you don't need to provide To enable debugging of a bundled app (Webpacked) with Chrome Dev Tools use
If you want to debug a Webpack enabled app with VSCode you need to manually add
and the options in launch.json should look like this one
|
@NickIliev thanks for the fast reply. I have followed the instructions and am running I also updated my webpack.config.js to match the new settings by running the updater script and then reapplying my small changes. It works
that was the missing piece in my webpack config which needed to be enabled. At first I forgot that line, no sourcemaps. Now it works. Thank you! Only thing now is, it is showing the generated JS instead of the source TS. The file names are mapped properly, but not the TS source. Hmm... any ideas? |
@IAMtheIAM you should see the TS files (if debugging TS or Angular project) at least these are the files I am seeing through my test project. The TS files (along with all XML, CSS) in ChromeDevTools should be located in Elements tab > |
Implemented in the latest nativescript-dev-webpack via the linked PRs |
@NickIliev I still dont see the correct stacktrace with the latest dev webpack.
The source map is present in the compiled js files but the source map is not used on "print". |
If you are having troubles with |
@NickIliev i am not running through vscode debugger. Only |
@NickIliev I'm running
if not, is there a way for PS: love hmr BTW. Great work! |
@rynop there is a bug in the cli. it won't translate for webpack projects. I opened an issue there |
Can you link to the other issue? |
@arielnmz I'm guessing it's this issue, in case anyone else is looking for it: NativeScript/nativescript-cli#4604 |
As mentioned by @NickIliev, adding the following to
Why is this not default? I've watched an old video tutorial of nativescript and they just launch the debugger in VSCode and it just works. Didn't change anything to |
Currently debugging with webpack is available but you cannot debug the original source -- enable this functionality by inlining source maps when app is started with
tns debug ... --bundle
command.Debugging with source maps should be supported both from chrome devtools as well as vscode.
The text was updated successfully, but these errors were encountered: