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

"Attach to packager" looking for wrong debuggerWorker.js #947

Closed
JamesPerlman opened this issue Mar 21, 2019 · 5 comments
Closed

"Attach to packager" looking for wrong debuggerWorker.js #947

JamesPerlman opened this issue Mar 21, 2019 · 5 comments

Comments

@JamesPerlman
Copy link

JamesPerlman commented Mar 21, 2019

I'm using [email protected] with vscode-react-native version 0.9.0 and when I try to attach to packager I'm seeing this in my packager output:
GET /debugger-ui/debuggerWorker.js 404 168 - 0.275 ms

It's because the debuggerWorker.js is not located inside the debugger-ui directory. It's at the root directory. I can successfuly GET /debuggerWorker.js from Postman or Chrome.

Is there a way to easily change the config on my end to point to the correct debuggerWorker.js?

@SounD120
Copy link
Contributor

SounD120 commented Mar 22, 2019

Hi @JamesPerlman . Could you please fill all the information as noted in our issue template? It will help to better understand the situation from our side.

@JamesPerlman
Copy link
Author

JamesPerlman commented Mar 22, 2019

Actual Behavior

  1. Run npm run haul -- --platform ios in a terminal at the project root
  2. Run Attach to packager debug command
  3. Extension fails to find debuggerWorker.js and never attaches to packager, Haul outputs a 404 error:
    GET /debugger-ui/debuggerWorker.js 404 168 - 0.275 ms

Expected Behavior

  1. Run npm run haul -- --platform ios in a terminal at the project root
  2. Run Attach to packager debug command
  3. Extension finds /debuggerWorker.js, VS Code attaches to packager and allows debugging

Software versions

  • React-Native VS Code extension version: 0.9.0
  • VSCode version: 1.32.3
  • OS platform and version: Mac OS X 10.14
  • NodeJS version: v8.11.1
  • React Native version: 0.55.4
  • Expo SDK version (include if relevant): N/A

Outputs (Include if relevant)

  • Output of the Debug Console (View -> Toggle Debug Console):
OS: darwin x64
Adapter node: v10.2.0 x64
vscode-chrome-debug-core: 6.7.40
Starting debugger app worker.
Could not debug. <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /debugger-ui/debuggerWorker.js</pre>
</body>
</html>
  • Output of the React-Native output channel (View -> Toggle Output -> Select React-Native in ListBox):
    N/A. React-Native is not listed as an option.

  • Output of the Developer Tools console (Help -> Toggle Developer Tools -> Select Console tab):

[Extension Host] debugger listening on port 56500
log.ts:161  INFO no standard startup: panel is active
console.ts:134 [Extension Host] INVALID text edit -> must have at least a label
t.log @ console.ts:134
11/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js:2849 [1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing
scanNext @ /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js:2849
3log.ts:173   ERR TypeScript Server Error (3.3.3)
Cannot read property 'emitNode' of undefined
TypeError: Cannot read property 'emitNode' of undefined
    at Object.getCommentRange (tsserver.js:62203:29)
    at emitNodeList (tsserver.js:84777:51)
    at emitList (tsserver.js:84659:13)
    at Object.writeList (tsserver.js:82331:13)
    at tsserver.js:104778:29
    at Object.mapToDisplayParts (tsserver.js:94785:13)
    at itemInfoForParameters (tsserver.js:104775:41)
    at getSignatureHelpItem (tsserver.js:104741:95)
    at tsserver.js:104714:79
    at Array.map (<anonymous>)
    at createSignatureHelpItems (tsserver.js:104714:36)
    at tsserver.js:104386:120
    at Object.runWithCancellationToken (tsserver.js:31173:28)
    at tsserver.js:104386:44
    at Object.firstDefined (tsserver.js:238:26)
    at tsserver.js:104382:27
    at Object.firstDefined (tsserver.js:238:26)
    at createJSSignatureHelpItems (tsserver.js:104381:56)
    at Object.getSignatureHelpItems (tsserver.js:104315:56)
    at Object.getSignatureHelpItems (tsserver.js:118650:37)
    at IOSession.Session.getSignatureHelpItems (tsserver.js:126706:62)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (tsserver.js:125660:61)
    at tsserver.js:127127:88
    at IOSession.Session.executeWithRequestId (tsserver.js:127118:28)
    at IOSession.Session.executeCommand (tsserver.js:127127:33)
    at IOSession.Session.onMessage (tsserver.js:127149:35)
    at Interface.<anonymous> (tsserver.js:128410:27)
    at Interface.emit (events.js:182:13)
    at Interface._onLine (readline.js:290:10)
    at Interface._normalWrite (readline.js:433:12)
    at Socket.ondata (readline.js:149:10)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:279:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at Pipe.onread (net.js:636:20): Error: TypeScript Server Error (3.3.3)
Cannot read property 'emitNode' of undefined
TypeError: Cannot read property 'emitNode' of undefined
    at Object.getCommentRange (tsserver.js:62203:29)
    at emitNodeList (tsserver.js:84777:51)
    at emitList (tsserver.js:84659:13)
    at Object.writeList (tsserver.js:82331:13)
    at tsserver.js:104778:29
    at Object.mapToDisplayParts (tsserver.js:94785:13)
    at itemInfoForParameters (tsserver.js:104775:41)
    at getSignatureHelpItem (tsserver.js:104741:95)
    at tsserver.js:104714:79
    at Array.map (<anonymous>)
    at createSignatureHelpItems (tsserver.js:104714:36)
    at tsserver.js:104386:120
    at Object.runWithCancellationToken (tsserver.js:31173:28)
    at tsserver.js:104386:44
    at Object.firstDefined (tsserver.js:238:26)
    at tsserver.js:104382:27
    at Object.firstDefined (tsserver.js:238:26)
    at createJSSignatureHelpItems (tsserver.js:104381:56)
    at Object.getSignatureHelpItems (tsserver.js:104315:56)
    at Object.getSignatureHelpItems (tsserver.js:118650:37)
    at IOSession.Session.getSignatureHelpItems (tsserver.js:126706:62)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (tsserver.js:125660:61)
    at tsserver.js:127127:88
    at IOSession.Session.executeWithRequestId (tsserver.js:127118:28)
    at IOSession.Session.executeCommand (tsserver.js:127127:33)
    at IOSession.Session.onMessage (tsserver.js:127149:35)
    at Interface.<anonymous> (tsserver.js:128410:27)
    at Interface.emit (events.js:182:13)
    at Interface._onLine (readline.js:290:10)
    at Interface._normalWrite (readline.js:433:12)
    at Socket.ondata (readline.js:149:10)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:279:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at Pipe.onread (net.js:636:20)
	at Function.create (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:173406)
	at v.dispatchResponse (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:178712)
	at v.dispatchMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:177464)
	at constructor._reader.onData.e (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:176820)
	at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:43:254)
	at t.Reader.onLengthData (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:182680)
	at Socket.t.Reader.constructor.e.on.e (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:182328)
	at Socket.emit (events.js:182:13)
	at addChunk (_stream_readable.js:279:12)
	at readableAddChunk (_stream_readable.js:264:11)
	at Socket.Readable.push (_stream_readable.js:219:10)
	at Pipe.onread (net.js:636:20)
console.ts:134 [Extension Host] (node:40615) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
t.log @ console.ts:134

Thanks for your help!

@JamesPerlman
Copy link
Author

BTW here's my launch.json file. I'm using webpack also.

  "version": "0.2.0",
  "configurations": [
    {
      "name": "Attach to packager",
      "program": "${workspaceRoot}/.vscode/launchReactNative.js", // This is mandatory but the file doesn't exist, don't worry about it.
      "type": "reactnative",
      "request": "attach",
      "sourceMaps": true,
      "outDir": "${workspaceRoot}/.vscode/.react",
      "sourceMapPathOverrides": {
        "webpack:///./~/*":   "${workspaceRoot}/node_modules/*",
        "webpack:///./*":   "${workspaceRoot}/*",
        "webpack:///*":     "*"
      }
    }
  ]
}

@SounD120
Copy link
Contributor

Hi @JamesPerlman . Thanks for details, I was able to reproduce this behaviour and I'm working on a fix now.

@ruslan-bikkinin
Copy link
Contributor

ruslan-bikkinin commented Apr 1, 2019

Hi @JamesPerlman we just released 0.9.1. In this version we added debug configuration parameter debuggerWorkerUrlPath, that you can use to override path to the debuggerWorker.js, e.g. if modern packagers uses URL like https://localhost:8081/ui-debugger/debuggerWorker.js, by using this parameter you can override ui-debugger value with the one you needed. In you case, you should set it to empty string: "debuggerWorkerUrlPath": "" to make it work with your version of Haul.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants