NativeScript / NativeScript/nativescript-cli
[Bundle workflow] Breakpoint in linked source not hit in VSCode on lightweight app initial load
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- JavaScript
- Estrelas
- 1.1k
- Forks
- 204
- Merge médio
- 1d 9h
- PRs com merge (30d)
- 8
Descrição
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
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Reproduza o aplicativo Android leve usando os comandos NativeScript listados e, em seguida, comece com tns-core-modules/ui/bottom-navigation/bottom-navigation.android.ts e a configuração stopOnEntry em launch.json. Rastreie o fluxo de inicialização inicial e de depuração de source maps para determinar por que OnLoaded() é ignorado, usando a solução alternativa com debugger como comparação. Está concluído quando o breakpoint é atingido durante o carregamento inicial do aplicativo sem adicionar debugger;.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- android, javascript, typescript, vscode
- Domínio
- cli, developer-experience, mobile-dev
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100