Skip to content

Exception in the debug console: `rejected promise not handled within 1 second: TypeError: Cannot read property 'substr' of undefined #34

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

Closed
CoderAllan opened this issue Nov 12, 2021 · 10 comments
Assignees
Labels
archived Archived and locked issues bug Something isn't working

Comments

@CoderAllan
Copy link

Describe the bug
In Visual Studio Code I'm currently developing an extension for processing GCode files.
When the extension is launched a new instance of VSCode opens where two gcode files are opened by default.
The moment I click on the gcode file that is not active the exception shown below is shown in the host VSCode instance debug console. See attached screenshot.

Expected behavior
The extension should be able to highlight the GCode without throwing the errors in the debug console.

Environment / Version:

  • OS Version: Windows 10
  • VSCode Version: 1.62
  • Extension Version: 0.6.2

Additional context
Stacktrace from the debug console:
rejected promise not handled within 1 second: TypeError: Cannot read property 'substr' of undefined stack trace: TypeError: Cannot read property 'substr' of undefined at x.parseLine (c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.6.2\dist\extension.js:1:17709) at x.getBlocks (c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.6.2\dist\extension.js:1:12527) at new x (c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.6.2\dist\extension.js:1:12336) at E.parseTree (c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.6.2\dist\extension.js:1:22213) at E.refresh (c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.6.2\dist\extension.js:1:22010) at E.onDocumentChanged (c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.6.2\dist\extension.js:1:21198) at c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.6.2\dist\extension.js:1:9526 at l.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1712) at I.$acceptModelChanged (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:94:152916) at n._doInvokeHandler (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:98:13802) at n._invokeHandler (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:98:13486) at n._receiveRequest (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:98:12148) at n._receiveOneMessage (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:98:10826) at c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:98:8922 at l.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1712) at s.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:15990) at c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:113:30625 at l.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1712) at s.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:15990) at f._receiveMessage (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:21260) at c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:18138 at l.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1712) at w.acceptChunk (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:13351) at c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:12699 at Socket.m (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:113:13575) at Socket.emit (events.js:315:20) at addChunk (internal/streams/readable.js:309:12) at readableAddChunk (internal/streams/readable.js:284:9) at Socket.push (internal/streams/readable.js:223:10) at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

Screenshot
Exception

@mikecentola mikecentola added the need-more-info Need More Information label Nov 30, 2021
@mikecentola mikecentola self-assigned this Nov 30, 2021
@mikecentola
Copy link
Member

I can't seem to reproduce this on my end. I just updated the extension with the latest vscode engines. Give the new version a try and let me know if that helps it.

@CoderAllan
Copy link
Author

CoderAllan commented Dec 1, 2021

The extension has been updated to v0.7.0, but I still experience the same issue as you can see below.
But I noticed that the exception is only thrown for two of the files I'm testing with.
So the attached files Test1 and Test2 are both producing the error, but the Test3 is not producing the error. I had to rename the files in order to attach them...
Test1.txt
Test2.txt
Test3.txt

rejected promise not handled within 1 second: TypeError: Cannot read property 'substr' of undefined stack trace: TypeError: Cannot read property 'substr' of undefined at _.parseLine (c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.7.0\dist\extension.js:1:13392) at _.getBlocks (c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.7.0\dist\extension.js:1:8210) at new _ (c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.7.0\dist\extension.js:1:8019) at P.parseTree (c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.7.0\dist\extension.js:1:19392) at P.refresh (c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.7.0\dist\extension.js:1:19189) at P.onActiveEditorChanged (c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.7.0\dist\extension.js:1:17845) at c:\Users\Allan\.vscode\extensions\appliedengdesign.vscode-gcode-syntax-0.7.0\dist\extension.js:1:5128 at l.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1712) at c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:95:63131 at l.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1712) at b.acceptDocumentsAndEditorsDelta (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:94:156060) at b.$acceptDocumentsAndEditorsDelta (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:94:154149) at n._doInvokeHandler (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:98:13802) at n._invokeHandler (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\ resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:98:13486) at n._receiveRequest (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:98:12148) at n._receiveOneMessage (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:98:10826) at c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:98:8922 at l.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1712) at s.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:15990) at c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:113:30625 at l.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1712) at s.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:15990) at f._receiveMessage (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:21260) at c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:18138 at l.fire (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:66:1712) at w.acceptChunk (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:13351) at c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:74:12699 at Socket.m (c:\Users\Allan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:113:13575) at Socket.emit (events.js:315:20) at addChunk (internal/streams/readable.js:309:12) at readableAddChunk (internal/streams/readable.js:284:9) at Socket.push (internal/streams/readable.js:223:10) at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

@mikecentola
Copy link
Member

@CoderAllan OK let me download the files and try them here.

Side note, what kind of extension are your trying to make? Maybe we can incorporate it into this one?

@mikecentola mikecentola added bug Something isn't working and removed need-more-info Need More Information labels Dec 2, 2021
@mikecentola
Copy link
Member

@CoderAllan figured it out. Working on a fix

@CoderAllan
Copy link
Author

Side note, what kind of extension are your trying to make? Maybe we can incorporate it into this one?

The extension I'm working on is a preview function for gcode.

@mikecentola
Copy link
Member

Side note, what kind of extension are your trying to make? Maybe we can incorporate it into this one?

The extension I'm working on is a preview function for gcode.

Oh awesome? Like backplotting? I've been working on trying to integrate backplotting into this one. We should collaborate for sure.

@CoderAllan
Copy link
Author

Yes, like backplotting. 2D only because my focus is laser engraving. I have no idea how to even start doing anything in 3D in vscode.
I will make a fork of vscode-gcode-syntax and dump what I got into it so you can see it. But be warned, there is a lot of work to be done before this could be released and the code is very proof-of-concept-messy at the moment.

@mikecentola
Copy link
Member

@CoderAllan awesome! I'll check it out for sure.

@mikecentola
Copy link
Member

Fixed in v0.7.1

@github-actions
Copy link

github-actions bot commented Aug 3, 2022

This issue has been automatically locked since there has not been any recent activity after it was close. Please open a new issue for related topics.

@github-actions github-actions bot added the archived Archived and locked issues label Aug 3, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived and locked issues bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants