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

Debuging es6 Proxy as property -> Internal error: illegal access #12749

Closed
jiron12 opened this issue Sep 27, 2016 · 16 comments
Closed

Debuging es6 Proxy as property -> Internal error: illegal access #12749

jiron12 opened this issue Sep 27, 2016 · 16 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@jiron12
Copy link

jiron12 commented Sep 27, 2016

  • VSCode Version: 1.2.1
  • OS Version: Windows 10

Steps to Reproduce:

1 - If I, in node.js 6.6, write (resp. have transpiled from TypeScript) a class like that:

 class Table {
    constructor(args) {
         this._rows = new Proxy({ test: 42 }, {});
    }
 }

2 - And then instantiate it like this:

var table = new Table();

3 - When I debug in Visual Studio Code and I want to watch the var table I always have

Internal error: illegal access

written there, meaning I can not watch table or any of its properties.

The same thing works perfectly fine in Chrome.

I have raised this on Stackoverflow:
http://stackoverflow.com/questions/39710014/debuging-es6-proxy-as-property-internal-error-illegal-access

@roblourens
Copy link
Member

VSCode 1.2 is rather old, but in the newest version, I see an empty variables pane and that error is thrown internally. Playing with it, it usually works in Chrome devtools but I've seen that error there too -

image

will address it but probably not for 1.6

@roblourens roblourens added the debug Debug viewlet, configurations, breakpoints, adapter issues label Sep 28, 2016
@jiron12
Copy link
Author

jiron12 commented Sep 29, 2016

But should I anyway be able to debugg Proxy objects run in node.js in vscode? Because in fact at lest in my case it does not seam to work... when I create a Proxy object as var and not as property I do not see any variables under 'Variables' in the Debugger view at all and when I add one to the watch I see same message on it 'illegal access'.

Btw.: node.js Version 6.7.0

@roblourens
Copy link
Member

Yes, it's a bug that it doesn't work.

@jiron12
Copy link
Author

jiron12 commented Oct 3, 2016

I'd be very happy to see this fixed soon.

@weinand weinand added the bug Issue identified by VS Code Team member as probable bug label Oct 10, 2016
@weinand
Copy link
Contributor

weinand commented Oct 10, 2016

@roblourens would this work with node2?

@roblourens
Copy link
Member

Not for Node 6.x (with the same errors in chrome devtools), but it works in the latest 7 nightlies.

@roblourens
Copy link
Member

roblourens commented Nov 4, 2016

@weinand This is worse in Node 7 for node-debug - the debugger crashes entirely when there is a Proxy object in scope.

@weinand
Copy link
Contributor

weinand commented Dec 5, 2016

This node crash occurs when retrieving the stack trace through the v8 debugger protocol:

#
# Fatal error in ../deps/v8/src/runtime/runtime-debug.cc, line 1423
# Check failed: args[0]->IsJSObject().
#

==== C stack trace ===============================

    0   node                                0x0000000100bcb6d3 v8::base::debug::StackTrace::StackTrace() + 19
    1   node                                0x0000000100bc8859 V8_Fatal + 233
    2   node                                0x00000001007bdfb6 v8::internal::Runtime_DebugGetPrototype(int, v8::internal::Object**, v8::internal::Isolate*) + 438
    3   ???                                 0x000006b8b4c063a7 0x0 + 7390376256423

There is nothing I can do about this (and node-inspector shows exactly the same behaviour).

@weinand weinand removed this from the November 2016 milestone Dec 5, 2016
@jiron12
Copy link
Author

jiron12 commented Dec 5, 2016

So I understand this is out of your reach? Would you recommend me to file a bug to V8?

@roblourens
Copy link
Member

The debug code there is deprecated so it's pretty unlikely to be fixed (and that's why these issues pop up with new JS features). I recommend using "type": "node2" in your launch config to opt-in to the new debug protocol, instead of 'node', and Node v7+, which worked for proxies last I tried.

@weinand
Copy link
Contributor

weinand commented Dec 5, 2016

@roblourens I suggest that you add this info to the November release notes under a "node2 update" item.

@jiron12
Copy link
Author

jiron12 commented Dec 5, 2016

Thank you very much! That works indeed!

Wild times! The new one is still labeled experimental, the old one is already deprecated! :)

@weinand
Copy link
Contributor

weinand commented Dec 5, 2016

@jiron12 no, VS Code's old node debug is not deprecated.
@roblourens statement about the "debug code there is deprecated" was referring to the v8 debug code in node.js itself.

roblourens added a commit to microsoft/vscode-docs that referenced this issue Dec 8, 2016
@roblourens roblourens added upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed bug Issue identified by VS Code Team member as probable bug labels Dec 16, 2016
@roblourens
Copy link
Member

Documented this in the release notes - closing as upstream

@pannous
Copy link

pannous commented Feb 2, 2017

can "type": "node2" be set as default somewhere / for single file debugging ?

@weinand
Copy link
Contributor

weinand commented Feb 3, 2017

@pannous You could try to use this approach: https://code.visualstudio.com/updates/v1_9#_user-level-launchjson

In the next release we will pick the correct debugger automatically.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants