NativeScript / NativeScript/nativescript-cli
[Bundle workflow] Breakpoint in linked source not hit in VSCode on lightweight app initial load
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 1.1k
- Forks
- 204
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 8
Descripción
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- CLI: rc
- Cross-platform modules: rc
- Android Runtime: rc
Describe the bug
Breakpoint in linked tns-core-modules source is not hit in VSCode on initial app start when using a very thin (lightweight) NativeScript app (e.g. created from blank template) even when stopOnEntry is set to true. After initial load debugging works as expected. A workaround proposed by @DimitarTachev is to place a debugger; statement in the beginning of the file-to-debug.
To Reproduce
git clone git@github.com:NativeScript/NativeScript.gitcd NativeScripttns create bottom-nav-test --template tns-template-blank-tscd bottom-nav-testtns migrate- Open NativeScript folder in VSCode
- Replace the contents of bottom-nav-test/app-root.xml with:
<BottomNavigation>
<TabStrip>
<TabStripItem title="First"></TabStripItem>
<TabStripItem title="Second"></TabStripItem>
</TabStrip>
<TabContentItem>
<GridLayout>
<Label text="First View" />
</GridLayout>
</TabContentItem>
<TabContentItem>
<GridLayout>
<Label text="Second View" />
</GridLayout>
</TabContentItem>
</BottomNavigation>
- Place a breakpoint in the
OnLoaded()method in tns-core-modules/ui/bottom-navigation/bottom-navigation.android.ts - Configure NativeScript debugging and add the following debug configuration in launch.json:
{
"name": "bottom-nav | Launch on Android",
"type": "nativescript",
"request": "launch",
"platform": "android",
"appRoot": "${workspaceRoot}/bottom-nav-test",
"sourceMaps": true,
"stopOnEntry": true,
"watch": true
},
- Try to debug using the newly added configuration
- Breakpoint in
OnLoaded()is not hit
Expected behavior
Breakpoints should work on initial app start as well
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Reproduce la aplicación Android ligera usando los comandos de NativeScript indicados y, a continuación, comienza con tns-core-modules/ui/bottom-navigation/bottom-navigation.android.ts y la configuración stopOnEntry de launch.json. Sigue el flujo de depuración del inicio inicial y de los source maps para determinar por qué se omite OnLoaded(), usando la solución alternativa con debugger como comparación. Se considera terminado cuando el breakpoint se alcanza durante la carga inicial de la aplicación sin añadir debugger;.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- android, javascript, typescript, vscode
- Área
- cli, developer-experience, mobile-dev
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100