No more source map while debugging nativescript app
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- android, ios, javascript, vscode, webpack
- Ambito
- cli, devtools, mobile-dev
Direzione di ricerca
Riproducete il comportamento del debugger con il progetto ufficiale Vue Tabs, Items.vue e i passaggi elencati per Chrome o Visual Studio Code. Leggete prima webpack.config.js e i file dell’adattatore di debug NativeScript referenziati, quindi confrontate la mappatura del codice sorgente generata con la posizione di Items.vue nello stack delle chiamate. Il lavoro è completato quando i file .vue si aprono con una copertura valida della source map in entrambi i percorsi del debugger, senza l’errore di avvio segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Issue Description
Since about March 10th 2022 debugging in chrome and VS Code fails as there is no more valid source mapping for the .vue files.
The line number of breakpoints of the original .vue file is correct but the .vue file is not opened with an error hint that the source map coverage is n/a. But if you add the "debugger" command in a method and the debugger halts the .vue file is opened correclty (sometimes)?! Also when a hot deploy is committed you get the correct .vue file.
This error on debugging occurs in the latest package version(s) and the demo project.
The following example program is an official demo project from nativescript:
In the call stack, you can see onItemTab method and the reference to Items.vue:93

Versions
node.js 16.4.2
nativescript 8.2.3
npm 8.5.0
java openJdk 11
package.json:
{
"name": "test",
"main": "app/app.js",
"version": "1.0.0",
"private": true,
"dependencies": {
"@nativescript/core": "~8.2.0",
"@nativescript/theme": "~3.0.2",
"nativescript-vue": "~2.9.0"
},
"devDependencies": {
"@nativescript/android": "8.2.2",
"@nativescript/webpack": "~5.0.6",
"nativescript-vue-template-compiler": "~2.9.0"
}
}
ns doctor output
✔ Getting environment information
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.2.3 version and is up to date.
✔ Component @nativescript/core has 8.2.1 version and is up to date.
✖ Component @nativescript/ios is not installed.
✔ Component @nativescript/android has 8.2.2 version and is up to date.
Reproduction
Reproduce this issue
With chrome dev tools
- Create a new project with "ns create --vue", give a name and select "Tabs"
- Add "debugger;" to Items.vue in the method "onItemTab" (line 92)
- Install an emulator or connect a hardware android device and start it
- Run the debugger with "ns debug android"
- Start the chrome dev tools: "devtools://devtools/bundled/inspector.html?ws=localhost:40000"
- Click in the app on a row to trigger the breakpoint
- Now you should see an precompiled version of Items.vue and in the "Call Stack" the line reference 93
We have this issue on all platforms (windows+android and mac+ios)
With Visual Studio Code
- Create a new project with "ns create --vue", give a name and select "Tabs"
- Open root directory with VS Code
- Install the "NativeScript" extension
- Open the run and debug tab
- Click on create launch.json and select "NativeScript"
- Select "Run on Android" and run the debugger
- You should now see an error message in the debug console
Relevant log output (if applicable)
Debugging with Visual Studio Code
Visual Studio Code shows the following exception while starting the debugger:
Error when trying to require webpack.config.js file from path '<PATH TO PROJECT ROOT DIRECOTRY>\webpack.config.js'. Error is: Error: Cannot find module 'C:\Users\<USERNAME>\AppData\Local\Programs\Microsoft VS Code\package.json'
Require stack:
- <PATH TO ROOT PROJECT DIRECTORY>\node_modules\@nativescript\webpack\dist\helpers\project.js
- <PATH TO ROOT PROJECT DIRECTORY>\node_modules\@nativescript\webpack\dist\helpers\dependencies.js
- <PATH TO ROOT PROJECT DIRECTORY>\node_modules\@nativescript\webpack\dist\helpers\externalConfigs.js
- <PATH TO ROOT PROJECT DIRECTORY>\node_modules\@nativescript\webpack\dist\index.js
- <PATH TO ROOT DIRECTORY>\webpack.config.js
- c:\Users\<USERNAME>\.vscode\extensions\nativescript.nativescript-0.12.3\out\debug-adapter\nativeScriptDebugAdapter.js
- c:\Users\<USERNAME>\.vscode\extensions\nativescript.nativescript-0.12.3\out\debug-adapter\nativeScriptDebug.js
- C:\Users\<USERNAME>\AppData\Local\Programs\Microsoft VS Code\[eval]
Environment
No response
Please accept these terms
- I have searched the existing issues as well as StackOverflow and this has not been posted before
- This is a bug report
- I agree to follow this project's Code of Conduct
- Lingua principale
- JavaScript
- Stelle
- 1.1k
- Fork
- 204
- Merge medio
- 1g 9h
- PR unite (30g)
- 8
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NativeScript/nativescript-cli
-
in-progress
NativeScript/nativescript-cli#6140 · 2 commenti · 1 assegnatario ·
-
NativeScript/nativescript-cli#6090 · 1 assegnatario ·
-
in progress
NativeScript/nativescript-cli#6015 · 1 reazione · 1 assegnatario ·
-
question
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
NativeScript/nativescript-cli#5992 · 5 commenti ·
-
feature-pending-triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
NativeScript/nativescript-cli#5975 ·
Tutte le issue di NativeScript/nativescript-cli
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy-website#2595 ·