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

Extension is overriding console... cannot debug other extensions with this one installed #46

Open
chrisdias opened this issue Jun 24, 2017 · 7 comments

Comments

@chrisdias
Copy link

It looks like this extension overloads console. what this means is that if I have this extension installed and I try to debug another extension that uses console.log statements, those statements are not sent to the debug console in vscode.

to repro:

  • install this extension
  • open vs code, open another extension project
  • in that project, put a console.log statement in.
  • F5 to run app, hit code path that executes the console.log statement

Result: no output in VS Code's Debug Console.

  • uninstall this extension, restart VS Code
  • load the extension project again
  • F5 to run, execute code path with console.log

Result: Console log output is in the Debug Console.

@chrisdias
Copy link
Author

actually, it looks like diagnostic-channel-publisher node module that is doing this.

image

@bradygaster-zz
Copy link
Owner

@chrisdias do you have a proposed fix for this or is this no longer something this extension's to blame for? let me know if there's something i can fix here and we'll get it done.

@chrisdias
Copy link
Author

no proposals other than removal of the offending lib?

@bradygaster-zz
Copy link
Owner

@chrisdias i don't think i can remove it - it is a dependency of the app insights SDK package, which i'm using. Since i'm using that, i get this, and can't remove it. i think this is a question for the app insights team, unless it's something specific in the way i'm using their SDK. have any advice on a contact i could reach out to there?

@daviwil
Copy link

daviwil commented Sep 12, 2017

Looks like the AppInsights SDK for Node.js (which the AzureRM Tools Extension uses) leverages the Zone.js module to instrument a lot of code in the extension host process. This is causing the PowerShell extension to fail when loading because Zone.js is hijacking fs.appendFile and their wrapper implementation is throwing an error that I don't see when the Azure extensions haven't been installed:

image

I was under the impression that extensions were sandboxed in different processes, but it appears that's not the case after all? At any rate, this module is causing trouble for other extensions so I think we need to find a way around this problem. I'll continue hacking around to see if I can find a solution on my side.

@daviwil
Copy link

daviwil commented Sep 13, 2017

Managed to fix the issue on my side, apparently I was missing an argument in fs.appendFile and the in-box Node.js implementation was happily ignoring it for the last 2 years :)

@bradygaster-zz
Copy link
Owner

so @daviwil is this a closed issue then since you found it in your own extension code? I experienced some other similar issues with the App Insights Node.js SDK, but they were helpful in learning how to work around the design decisions in the SDK.

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