Search Unity

Debugging in VSCode results in error.

Discussion in 'Editor & General Support' started by permalmberg, Dec 2, 2019.

  1. permalmberg

    permalmberg

    Joined:
    Dec 2, 2019
    Posts:
    6
    Hi,

    First time trying Unity and I'm having an issue with debugging scripts. Specifically, I'm getting the following error when when starting a debug run by pressing the "Start debugging" button in VS Code to attach to the Unity Editor:


    2019-12-02 23:13:27.784] [renderer1] [error] timeout after 500 ms: Error: timeout after 500 ms
    at t.RawDebugSession.handleErrorResponse (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2798:1003)
    at file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2798:434
    at async t.RawDebugSession.shutdown (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2796:536)


    This is the output from the console. It looks as if it attaches, but then times out?


    UnityDebug: Initializing
    UnityDebug: Searching for Unity process 'Unity Editor'
    UnityDebug: Attached to Unity process 'Unity Editor (Unity)' (14608)


    I'm running Unity and VSCode as a regular user.
    I've tried restarting both Unity and VS Code but the error remains.

    What to do?

    System info:

    System:
    Pop_OS! 19.10

    VSCode Unity plugin 2.7.2

    Unity:
    Version 2019.3.0f1 (ffacea4b84e7) Personal
    Fri, 22 Nov 2019 03:55:52 GMT
    Branch: 2019.3/staging

    VSCode:
    Version: 1.40.2
    Commit: f359dd69833dd8800b54d458f6d37ab7c78df520
    Date: 2019-11-25T14:54:40.719Z
    Electron: 6.1.5
    Chrome: 76.0.3809.146
    Node.js: 12.4.0
    V8: 7.6.303.31-electron.0
    OS: Linux x64 5.3.0-22-generic
     
  2. permalmberg

    permalmberg

    Joined:
    Dec 2, 2019
    Posts:
    6
    Anyone with any hint? Is there a better place to ask this?
     
  3. permalmberg

    permalmberg

    Joined:
    Dec 2, 2019
    Posts:
    6
    It seems the problem arises as soon as a break point is hit. Since I had breakpoints on Start() and Update() a breakpoint were guaranteed to be hit as soon as the debugger attached to Unity.

    The question is now, what am I doing wrong, surely breakpoints are supposed to work?
     
  4. mwalus

    mwalus

    Joined:
    Dec 7, 2017
    Posts:
    13
    Hi,
    I'm experiencing the same problem but on macOS. I cannot debug my app anymore using Visual Studio Code. However I can debug the same app using Visual Studio for Mac.


    macOS: 10.15.1 (19B88)
    Unity: 2019.2.13f1
    VSCode plugin: Debugger for Unity 2.7.2

    VSCode:
    Version: 1.40.2
    Commit: f359dd69833dd8800b54d458f6d37ab7c78df520
    Date: 2019-11-25T14:52:45.129Z
    Electron: 6.1.5
    Chrome: 76.0.3809.146
    Node.js: 12.4.0
    V8: 7.6.303.31-electron.0
    OS: Darwin x64 19.0.0
     
  5. permalmberg

    permalmberg

    Joined:
    Dec 2, 2019
    Posts:
    6
    So based on a data set of two, the VS Code extension is the cause of the problem.
     
  6. permalmberg

    permalmberg

    Joined:
    Dec 2, 2019
    Posts:
    6
    I downloaded Jetbrains Rider and it can debug just fine so it does seems the VS Code extension is the cause. I'll file an issue pointing to this thread.
     
  7. mwalus

    mwalus

    Joined:
    Dec 7, 2017
    Posts:
    13
  8. permalmberg

    permalmberg

    Joined:
    Dec 2, 2019
    Posts:
    6
    Did you try it?

    I think I'm going to go with Rider instead, seems to be much more competent.
     
  9. mwalus

    mwalus

    Joined:
    Dec 7, 2017
    Posts:
    13
    Yes, just checked and I'm able to debug now after updating "Debugger for Unity" plugin to 3.0.1 version installing it VSCode manually from "vsix".