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

Unexpected token L in JSON at position 0 #774

Closed
WasserEsser opened this issue Aug 24, 2018 · 3 comments
Closed

Unexpected token L in JSON at position 0 #774

WasserEsser opened this issue Aug 24, 2018 · 3 comments

Comments

@WasserEsser
Copy link

Actual Behavior

  1. Debugging doesn't work

Expected Behavior

  1. Debugging works

Software versions

  • React-Native VS Code extension version: 0.6.13
  • VSCode version: 1.26.1
  • OS platform and version: Windows 10 (17134)
  • NodeJS version: 8.9.3
  • React Native version: 0.55.4 (cli: 2.0.1)

Outputs (Include if relevant)

  • Output of the Debug Console (View -> Toggle Debug Console):
OS: win32 x64
Adapter node: v8.9.3 x64
vscode-chrome-debug-core: 3.17.3
2:20:24 PM, 8/24/2018
From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"reactnative","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-gb"})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"exceptionBreakpointFilters":[{"label":"All Exceptions","filter":"all","default":false},{"label":"Uncaught Exceptions","filter":"uncaught","default":false}],"supportsConfigurationDoneRequest":true,"supportsSetVariable":true,"supportsConditionalBreakpoints":true,"supportsCompletionsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsRestartFrame":true,"supportsExceptionInfoRequest":true,"supportsDelayedStackTraceLoading":true,"supportsValueFormattingOptions":true,"supportsEvaluateForHovers":true,"supportsLogPoints":true,"supportsTerminateRequest":false}}
Starting debugger app worker.
About to download: http://localhost:8081/debugger-ui/debuggerWorker.js to: C:\Users\Marcel Kirchhoff\Documents\TuS_Derschlag_Handball\.vscode\.react\debuggerWorker.js
Established a connection with the Proxy (Packager) to the React Native application
From RN APP: {"method":"$disconnected"}
From RN APP: {"id":0,"method":"prepareJSRuntime"}
A new app worker lifetime was created.
Spawned debuggee process with pid 9948 listening to 7409
Debugger worker loaded runtime on port 7409
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"debugStarted","data":{"request":"attach","args":["name","program","type","request","platform","sourceMaps","outDir","trace","__sessionId","port","address","restart","remoteRoot","localRoot","sourceMapPathOverrides","showAsyncStacks"]}}}
To RN APP: {"replyID":0}
From RN APP: {"id":1,"method":"executeApplicationScript","url":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","inject":{"__fbBatchedBridgeConfig":"{\"remoteModuleConfig\":[[\"StatusBarManager\",{\"HEIGHT\":30.4761905670166},[\"setColor\",\"setHidden\",\"setStyle\",\"setTranslucent\"]],[\"DeviceEventManager\",{},[\"invokeDefaultBackPressHandler\"]],[\"JSCSamplingProfiler\",{},[\"operationComplete\"]],[\"ImageEditingManager\",{},[\"cropImage\"]],[\"NativeAnimatedModule\",{},[\"addAnimatedEventToView\",\"connectAnimatedNodeToView\",\"connectAnimatedNodes\",\"createAnimatedNode\",\"disconnectAnimatedNodeFromView\",\"disconnectAnimatedNodes\",\"dropAnimatedNode\",\"extractAnimatedNodeOffset\",\"flattenAnimatedNodeOffset\",\"removeAnimatedEventFromView\",\"setAnimatedNodeOffset\",\"setAnimatedNodeValue\",\"startAnimatingNode\",\"startListeningToAnimatedNodeValue\",\"stopAnimation\",\"stopListeningToAnimatedNodeValue\"]],[\"AsyncSQLiteDBStorage\",{},[\"clear\",\"getAllKeys\",\"multiGet\",\"multiMerge\",\"multiRemove\",\"multiSet\"]],[\"LocationObserver\",{},[\"getCurrentPosition\",\"startObserving\",\"stopObserving\"]],[\"NetInfo\",{},[\"getCurrentConnectivity\",\"isConnectionMetered\"],[0,1]],[\"ShareModule\",{},[\"share\"],[0]],[\"JSDevSupport\",{},[\"setResult\"]],[\"DatePickerAndroid\",{},[\"open\"],[0]],[\"Vibration\",{},[\"cancel\",\"vibrate\",\"vibrateByPattern\"]],[\"CameraRollManager\",{},[\"getPhotos\",\"saveToCameraRoll\"],[0,1]],[\"PlatformCo[...]
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"targetDebugProtocolVersion","data":{}}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"targetCount","data":{"numTargets":1}}}
To client: {"seq":0,"type":"event","event":"capabilities","body":{"capabilities":{"supportsStepBack":false}}}
To client: {"seq":0,"type":"response","request_seq":2,"command":"launch","success":true}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"nodeVersion","data":{"version":"v10.7.0"}}}
To client: {"seq":0,"type":"event","event":"initialized"}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"loaders.js","path":"<node_internals>/internal/bootstrap/loaders.js","sourceReference":1000,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"node.js","path":"<node_internals>/internal/bootstrap/node.js","sourceReference":1001,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"VM15","path":"<eval>/VM15","sourceReference":1002,"origin":"read-only content from Node.js"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"events.js","path":"<node_internals>/events.js","sourceReference":1003,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"async_hooks.js","path":"<node_internals>/internal/async_hooks.js","sourceReference":1004,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"errors.js","path":"<node_internals>/internal/errors.js","sourceReference":1005,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"util.js","path":"<node_internals>/util.js","sourceReference":1006,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"encoding.js","path":"<node_internals>/internal/encoding.js","sourceReference":1007,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"util.js","path":"<node_internals>/internal/util.js","sourceReference":1008,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"types.js","path":"<node_internals>/internal/util/types.js","sourceReference":1009,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"buffer.js","path":"<node_internals>/buffer.js","sourceReference":1010,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"buffer.js","path":"<node_internals>/internal/buffer.js","sourceReference":1011,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"per_thread.js","path":"<node_internals>/internal/process/per_thread.js","sourceReference":1012,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"main_thread_only.js","path":"<node_internals>/internal/process/main_thread_only.js","sourceReference":1013,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"stdio.js","path":"<node_internals>/internal/process/stdio.js","sourceReference":1014,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"assert.js","path":"<node_internals>/assert.js","sourceReference":1015,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"assert.js","path":"<node_internals>/internal/assert.js","sourceReference":1016,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"fs.js","path":"<node_internals>/fs.js","sourceReference":1017,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"path.js","path":"<node_internals>/path.js","sourceReference":1018,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"constants.js","path":"<node_internals>/internal/constants.js","sourceReference":1019,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"utils.js","path":"<node_internals>/internal/fs/utils.js","sourceReference":1020,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"url.js","path":"<node_internals>/internal/url.js","sourceReference":1021,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"querystring.js","path":"<node_internals>/internal/querystring.js","sourceReference":1022,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"validators.js","path":"<node_internals>/internal/validators.js","sourceReference":1023,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"warning.js","path":"<node_internals>/internal/process/warning.js","sourceReference":1024,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"next_tick.js","path":"<node_internals>/internal/process/next_tick.js","sourceReference":1025,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"promises.js","path":"<node_internals>/internal/process/promises.js","sourceReference":1026,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"fixed_queue.js","path":"<node_internals>/internal/fixed_queue.js","sourceReference":1027,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"inspector_async_hook.js","path":"<node_internals>/internal/inspector_async_hook.js","sourceReference":1028,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"async_hooks.js","path":"<node_internals>/async_hooks.js","sourceReference":1029,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"child_process.js","path":"<node_internals>/child_process.js","sourceReference":1030,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"child_process.js","path":"<node_internals>/internal/child_process.js","sourceReference":1031,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"net.js","path":"<node_internals>/net.js","sourceReference":1032,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"stream.js","path":"<node_internals>/stream.js","sourceReference":1033,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"pipeline.js","path":"<node_internals>/internal/streams/pipeline.js","sourceReference":1034,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"end-of-stream.js","path":"<node_internals>/internal/streams/end-of-stream.js","sourceReference":1035,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"legacy.js","path":"<node_internals>/internal/streams/legacy.js","sourceReference":1036,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"_stream_readable.js","path":"<node_internals>/_stream_readable.js","sourceReference":1037,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"buffer_list.js","path":"<node_internals>/internal/streams/buffer_list.js","sourceReference":1038,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"destroy.js","path":"<node_internals>/internal/streams/destroy.js","sourceReference":1039,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"state.js","path":"<node_internals>/internal/streams/state.js","sourceReference":1040,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"_stream_writable.js","path":"<node_internals>/_stream_writable.js","sourceReference":1041,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"_stream_duplex.js","path":"<node_internals>/_stream_duplex.js","sourceReference":1042,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"_stream_transform.js","path":"<node_internals>/_stream_transform.js","sourceReference":1043,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"_stream_passthrough.js","path":"<node_internals>/_stream_passthrough.js","sourceReference":1044,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"net.js","path":"<node_internals>/internal/net.js","sourceReference":1045,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"stream_base_commons.js","path":"<node_internals>/internal/stream_base_commons.js","sourceReference":1046,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"timers.js","path":"<node_internals>/internal/timers.js","sourceReference":1047,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"dgram.js","path":"<node_internals>/dgram.js","sourceReference":1048,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"socket_list.js","path":"<node_internals>/internal/socket_list.js","sourceReference":1049,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"_http_common.js","path":"<node_internals>/_http_common.js","sourceReference":1050,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"freelist.js","path":"<node_internals>/internal/freelist.js","sourceReference":1051,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"http.js","path":"<node_internals>/internal/http.js","sourceReference":1052,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"_http_incoming.js","path":"<node_internals>/_http_incoming.js","sourceReference":1053,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"string_decoder.js","path":"<node_internals>/string_decoder.js","sourceReference":1054,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"timers.js","path":"<node_internals>/timers.js","sourceReference":1055,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"linkedlist.js","path":"<node_internals>/internal/linkedlist.js","sourceReference":1056,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"loader.js","path":"<node_internals>/internal/modules/cjs/loader.js","sourceReference":1057,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"vm.js","path":"<node_internals>/vm.js","sourceReference":1058,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"helpers.js","path":"<node_internals>/internal/modules/cjs/helpers.js","sourceReference":1059,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"console.js","path":"<node_internals>/console.js","sourceReference":1060,"origin":"read-only core module"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"VM75","path":"<eval>/VM75","sourceReference":1062,"origin":"read-only content from Node.js"}}}
To client: {"seq":0,"type":"event","event":"loadedSource","body":{"reason":"new","source":{"name":"debuggerWorker.js","path":"c:\\Users\\Marcel Kirchhoff\\Documents\\TuS_Derschlag_Handball\\.vscode\\.react\\debuggerWorker.js","origin":"read-only content from Node.js"}}}
From client: setExceptionBreakpoints({"filters":[]})
To client: {"seq":0,"type":"response","request_seq":3,"command":"setExceptionBreakpoints","success":true}
From client: configurationDone(undefined)
From client: threads(undefined)
To client: {"seq":0,"type":"response","request_seq":5,"command":"threads","success":true,"body":{"threads":[{"id":1,"name":"Node (9948)"}]}}
To client: {"seq":0,"type":"response","request_seq":4,"command":"configurationDone","success":true}
******** Unhandled error in debug adapter: SyntaxError: Unexpected token L in JSON at position 0
    at JSON.parse (<anonymous>)
    at Pipe.channel.onread (internal/child_process.js:470:28)
  • Output of the React-Native output channel (View -> Toggle Output -> Select React-Native in ListBox):
[Info] Starting Packager

Scanning folders for symlinks in c:\Users\Marcel Kirchhoff\Documents\TuS_Derschlag_Handball\node_modules (41ms)
┌──────────────────────────────────────────────────────────────────────────────┐
│                                                                              │
│  Running Metro Bundler on port 8081.                                         │
│                                                                              │
│  Keep Metro running while developing on any JS projects. Feel free to        │
│  close this tab and run your own Metro instance if you prefer.               │
│                                                                              │
│  https://github.com/facebook/react-native                                    │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

Looking for JS files in
   c:\Users\Marcel Kirchhoff\Documents\TuS_Derschlag_Handball
   c:\Users\Marcel Kirchhoff\Documents\TuS_Derschlag_Handball\.vscode 


Metro Bundler ready.

[Info] Packager started.

[Info] Prewarming bundle cache. This may take a while ...

[Info] About to get: http://localhost:8081/index.bundle?platform=android

Loading dependency graph, done.
[Warning] The Bundle Cache was prewarmed.

[Info] Building and running application.

 BUNDLE  [android, dev] ./index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (482/482), done.

[Info] Enable JS Debugging

Starting custom debugger by executing: echo A debugger is not needed:  "c:\Users\Marcel Kirchhoff\Documents\TuS_Derschlag_Handball" "c:\Users\Marcel Kirchhoff\Documents\TuS_Derschlag_Handball\.vscode"
Starting custom debugger by executing: echo A debugger is not needed:  "c:\Users\Marcel Kirchhoff\Documents\TuS_Derschlag_Handball" "c:\Users\Marcel Kirchhoff\Documents\TuS_Derschlag_Handball\.vscode"
Starting custom debugger by executing: echo A debugger is not needed:  "c:\Users\Marcel Kirchhoff\Documents\TuS_Derschlag_Handball" "c:\Users\Marcel Kirchhoff\Documents\TuS_Derschlag_Handball\.vscode"
  • Output of the Developer Tools console (Help -> Toggle Developer Tools -> Select Console tab):
Debug adapter process has terminated unexpectedly
t.onDidNotificationChange @ notificationsAlerts.ts:41
(anonymous) @ notificationsAlerts.ts:27
e.fire @ event.ts:140
t.notify @ notifications.ts:113
t.error @ notificationService.ts:52
t.onDebugAdapterExit @ rawDebugSession.ts:524
(anonymous) @ rawDebugSession.ts:167
e.fire @ event.ts:140
(anonymous) @ debugAdapter.ts:304
emitTwo @ events.js:131
emit @ events.js:214
__dirname.ChildProcess._handle.onexit @ internal/child_process.js:198

Neither debugging via Debug Android nor Run on Android, attach to packager and hitting debug js remotely work. I keep getting the same json parse error. I have reinstalled the extension several times, even weeks ago. I simply can't seem to debug my react native applications.

@WasserEsser WasserEsser changed the title Debugging won't work Unexpected token L in JSON at position 0 Aug 24, 2018
@ruslan-bikkinin
Copy link
Contributor

Hi @WasserEsser and thanks for submitting the issue. This issue has been resolved in v0.6.14. However we already have similar one #758, so I am going to close it for now. Please feel free to leave feedback there if problem still persists.

@reza7rm
Copy link

reza7rm commented Sep 29, 2018

I still encounter this issue on react native 0.57.1 and react native tools version:0.6.18 on windows 10. I donno why old issues reappear in new versions. It's really frustrating...

@ruslan-bikkinin
Copy link
Contributor

hi @reza7rm, please see #777 (comment)

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