rokucommunity / brighterscript

A superset of Roku's BrightScript language
MIT License
153 stars 47 forks source link

Cannot run debug with 2.45.12 #1032

Closed rrirower closed 6 months ago

rrirower commented 6 months ago

I updated my Brightscript VSCode version today to 2.45.12. When I try to debug some code, I get:

DebugServer: Encountered an issue during the publish process
DebugServer: Error: C:\Users\Mike\AppData\Local\Programs\Microsoft VS Code\debug\c:\Users\Mike\AppData\Local\Programs\Microsoft VS Code\source contains invalid WIN32 path characters.
    at Object.mkdirs (c:\Users\Mike\.vscode\extensions\rokucommunity.brightscript-2.45.12\node_modules\fs-extra\lib\mkdirs\mkdirs.js:18:22)
    at c:\Users\Mike\.vscode\extensions\rokucommunity.brightscript-2.45.12\node_modules\universalify\index.js:13:12
    at new Promise (<anonymous>)
    at Object.mkdirs (c:\Users\Mike\.vscode\extensions\rokucommunity.brightscript-2.45.12\node_modules\universalify\index.js:7:14)
    at c:\Users\Mike\.vscode\extensions\rokucommunity.brightscript-2.45.12\node_modules\roku-deploy\dist\RokuDeploy.js:320:32
    at Array.map (<anonymous>)
    at RokuDeploy.copyToStaging (c:\Users\Mike\.vscode\extensions\rokucommunity.brightscript-2.45.12\node_modules\roku-deploy\dist\RokuDeploy.js:317:39)
    at async RokuDeploy.prepublishToStaging (c:\Users\Mike\.vscode\extensions\rokucommunity.brightscript-2.45.12\node_modules\roku-deploy\dist\RokuDeploy.js:37:9)
    at async Project.stage (c:\Users\Mike\.vscode\extensions\rokucommunity.brightscript-2.45.12\node_modules\roku-debug\dist\managers\ProjectManager.js:233:9)
    at async BrightScriptDebugSession.prepareMainProject (c:\Users\Mike\.vscode\extensions\rokucommunity.brightscript-2.45.12\node_modules\roku-debug\dist\debugSession\BrightScriptDebugSession.js:512:9)
    at async Promise.all (index 0)
    at async BrightScriptDebugSession.launchRequest (c:\Users\Mike\.vscode\extensions\rokucommunity.brightscript-2.45.12\node_modules\roku-debug\dist\debugSession\BrightScriptDebugSession.js:191:13)
TwitchBronBron commented 6 months ago

Could you share your launch.json? (feel free to rename sensitive folder names). I tested using a few sample apps and it launches just fine for me on windows 11.

rrirower commented 6 months ago

I'm on Windows 10....

{
            "type": "brightscript",
            "request": "launch",
            "name": "BrightScript Debug: Launch",
            "enableDebugProtocol": true,
            "stopOnEntry": false,
            "host": "xxxxxxxxxx",
            "password": "xxxxx",
            "rootDir": "${workspaceFolder}\\debug",
            "logLevel": "trace",
            "fileLogging": true,
            "injectRdbOnDeviceComponent": true,            
            //run the BrighterScript build before each launch
            "preLaunchTask": "build"
        },
rrirower commented 6 months ago

Downgrading to 2.45.11 is a workaround. Waiting for an update.

rrirower commented 6 months ago

I'm not sure if it's related to downgrading, but, my previous usage of 'const' no longer works. The debugger reports my const values as 'uninitialized'. I'm currently at V0.65.18.

TwitchBronBron commented 6 months ago

I think I found a resolution to why it crashes during a debug session. Can you install the latest vscode extension (V2 45.13) and give it a try?

I don't have any idea why consts would be acting up. I'm hoping it's just a glitch cause by upgrading/downgrading vscode a few times. So after installing the latest vscode extension, can you try reloading vscode?

rrirower commented 6 months ago

Will do. I'll let you know tomorrow.

rrirower commented 6 months ago

Upgrading to 2.45.13 has resolved this issue.