On running the debugger for iOS the debugger worker fails to run printing this error:
SyntaxError: Unexpected token <
This is similar to this issue #580
To run the react-native app on the simulator with vscode debugger attached.
SyntaxError: Unexpected token <
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:152:10)
at Module._compile (module.js:605:28)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Function.Module.runMain (module.js:682:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:613:3

debuggerWorker.js has HTML markup inserted every time I run the debugger:

Is it react-native init project?
Also please paste Output of the React-Native output channel (View -> Toggle Output -> Select React-Native in ListBox).
It is a react-native init project.
The output of the React-Native output channel:

When I downgraded react-native to version 0.49.5 the problem disappeared.
Advised by the following thread:
https://github.com/Microsoft/vscode/issues/37734
However I need to use the latest react-native for my project so this isn't a viable solution.
I had this exact problem after updating from 0.49.5 to 0.51.0. Turning debugger off and on again fixed it.
P.S. I don't use VSCode, so I don't think this issue caused by this plugin, I got here via Google search.
@redlock
Sorry for delay.
Looks like you have run packager outside the vscode:
[Info] packager is already running.
Could you please check it and close packager if it's true. And try to run debug ios again from vscode.
Thanks!
Hi @redlock, please let us know if the issue still has place for you and if you have a chance to take a look at the message above.
I have same error in both cases: when packager started from within vscode and when I connect to external packager. This behaviour was checked few times and I had same result. Later I try to give more details.
Hey guys, I'm closing this for now, please feel free to reopen or create new one if the issue still has place for you. Please also provide us as much info as possible so we would be able to reproduce and fix this.