Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In line debugger - can't connect through websocket #1640

Closed
dev4s opened this issue Oct 12, 2020 · 1 comment · Fixed by #1641
Closed

In line debugger - can't connect through websocket #1640

dev4s opened this issue Oct 12, 2020 · 1 comment · Fixed by #1641
Assignees
Labels

Comments

@dev4s
Copy link
Contributor

dev4s commented Oct 12, 2020

Environment

  • CLI: 7.0.8
  • Core: 7.0.11
  • Android Runtime: 7.0.0
  • Plugin(s): nativescript vue
  • Chrome: 86.0.4240.75 (official 64 bit)
  • package.json
"dependencies": {
	"@nativescript/core": "^7.0.8",
	"@nativescript/webpack": "^3.0.0",
	"nativescript-couchbase-plugin": "^0.9.6",
	"nativescript-fonticon": "^2.0.2",
	"nativescript-vue": "^2.6.1",
	"nativescript-vue-navigator": "^1.2.0",
	"vue-class-component": "^7.2.6",
	"vue-property-decorator": "^9.0.0"
},
"devDependencies": {
	"@babel/core": "^7.0.0",
	"@babel/preset-env": "^7.0.0",
	"@nativescript/android": "7.0.0",
	"@nativescript/types": "^7.0.0",
	"@types/node": "^13.13.21",
	"babel-loader": "^8.1.0",
	"nativescript-vue-template-compiler": "^2.6.0",
	"node-sass": "^4.13.1",
	"typescript": "^3.8.3",
	"vue": "^2.6.11",
	"vue-loader": "^15.9.1"
}

Describe the bug
The system doesn't break on the 'debugger'' line when set on main.ts. and shows the message: 'can't connect through WebSocket'.

To Reproduce

  1. create a simple Vue project with TS.
  2. add a debugger to main.ts.
  3. run debugging from the command line (the specified one I've used:
ns debug android --debug-brk --emulator --timeout 300
  1. go to the predefined URL created by the ns command line (devtools://devtools/bundled/inspector.html?ws=localhost:40000).
  2. you should get the WebSocket disconnected message from chrome devtools.

Expected behavior

  1. Chrome devtools should break on the breakpoint.

Sample project

  • main.ts
import Vue from 'nativescript-vue';
import Main from './components/main.vue';

debugger;

Vue.config.silent = false;

new Vue({
	render: (h) => h('frame', [h(Main)]),
}).$start();

Additional context
I've set on the main.ts the breakpoint by using the 'debugger' (Debug CLI) option. After that I've run the command specified for debugging, I couldn't connect (at least that was what chrome devtools was showing). Some couple of tries later I've said enough and started to debug the android runtime by using one of your guidelines regarding debugging starting scripts in android-runtime (Debug android runtime), found the problem with the ShouldBreak method (it couldn't handle the scope with the isolate_) and also with getDocument method (The document is empty as it isn't loaded yet, I think) . To be honest, I'm not a specialist regarding C++ and Java, I'm experienced mostly in C# and some of the JavaScript.

@NathanaelA NathanaelA self-assigned this Oct 16, 2020
@NathanaelA NathanaelA added the bug label Oct 16, 2020
@NathanaelA

This comment was marked as abuse.

rigor789 added a commit that referenced this issue Sep 8, 2021
This partially reverts the fix from #1641 as it ends up never calling `m_backend->getDocument`.

This may bring back an issue from #1640 - though was unable to reproduce with latest everything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants