Why am I getting an error when loading webviews in VS Code? - visual-studio-code

I'm using a portable install of VS Code 1.56.1 on Windows 10. Whenever open an extension from the marketplace, I get the following error:
Error loading webview: Error: Could not register service workers: TypeError: Failed to register a ServiceWorker for scope ('vscode-webview://extensioneditor/') with script ('vscode-webview://extensioneditor/service-worker.js?platform=electron&id=extensionEditor&vscode-resource-origin=https%3A%2F%2FextensionEditor.vscode-webview-test.com'): ServiceWorker cannot be started.
Same thing happens for other things using webviews, with a slightly different path (like VS Code release notes). I'm able to install plugins and view the Feature Contributions tab, but I cannot view the Details and Changelog tabs.
Any thoughts on what could be causing this? This is on a managed machine where security settings might be changing. I'm using a portable install because my installed version stopped working out of the blue last week and this was supposed to be the workaround until that was figured out.

I was getting the same error, it looks like an issue introduced on version 1.56.0.
For me the fix was running VS Code without elevated permissions.
I always run as administrator and running without it fixed the issue for me.

I had this problem, in terminal use code . --no-sandbox
Updating python3 to the most recent version may also help.

Related

vscode extension: deprecation warning `Buffer()`, how to diagnose

I am rebuilding my comment highlighter in to a new extension.
However I now run now in to an issue where I get the following warning:
(node:4904) [DEP0005] DeprecationWarning:
Buffer() is deprecated due to security and usability issues.
Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
So far I can find in my extension I never use the function Buffer()
I think that it comes from the vscode module.
When the warning occurs block comment highlighting stops working.
This issue is breaking for my extension in development mode.
However my old extension has the same issue in development mode and released version.
Only in the released version doesn't report of the warning.
I am sorry for not including a minimal, reproducible example.
UPDATE:
In the latest release of my comment highlighter I have fixed block comment highlighting. At least I have fixed what was broken on my end.
The (node:4904) [DEP0005] DeprecationWarning keeps breaking my extension on rare occasions, this happens in all my environments.
Restarting vscode or rebooting the operating system can sometimes fix it. I have noticed that other extensions break as well when my extension is broken.
Operating systems I run:
Windows 10
Ubuntu 20 LTS
On both OSes I run nvm to manage node and npm versions.
I currently have 2 computers both dual booted with the named OSes
The issue occurs on both computers.
Here are the steps I used to help diagnose what is causing that Buffer deprecation warning.
Uninstall your extension. You may have to reload vscode after this.
Terminal: export NODE_OPTIONS=--throw-deprecation
Terminal: code-insiders --install-extension arturodent.find-and-transform
(or code --install-extension arturodent.find-and-transform if not on Insiders)
(replace with your extension id found in the package.json)
That should re-install the extension with a stack trace about the deprecation warning.
Obviously, if your extension directly used new Buffer() you can fix it.
If you imported/required an extension that uses new Buffer() you have a couple of options: look for an alternative, fork it or file an issue with that repository.
In my case, neither of the above was the issue. You can see that fd-slicer is the problem. And that is a dependency of yauzl. yauzl is used by vscode itself, not by me or by my extension's dependencies.
There are issues filed on fd-slicer (maintainer has no interest in fixing this, PR to fix) and on yauzl urging to switch to a forked fd-slicer2 which hasn't been merged yet (PR to fix - consider upvoting). And on vscode: buffer warning, yauzl.
My node version: v15.9.0
For me, this Buffer warning is currently an irritant only, and does not affect the functionality of my extension fortunately.
I encountered a somewhat similar incident while trying to create my first extension. So launching the Command Palette - Ctrl + Shift + P and selecting >Developer: Reload Window helped.
I hope you have been able to successfully overcome this issue as I have not seen many answers in online forums relating to this type of warning. VS Code is having trouble referencing your node module as you may have either and outdated version of node or double installation causing broken symlinks. This is usually fixed by uninstalling and reinstalling node using brew a couple of times then unlinking and relinking node once the broken symlinks are gone. The following video helps to explain just how to do this.
https://www.youtube.com/watch?v=DAnf4XUUjkg
After that simply restart your IDE and try launching VS code again! Hope this helps.

A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found

I tried internet search on this issue and it is very common with many suggestions. The problem started with an update to VS2019 in which I paused because my projects in VSCode were breaking.I did a system restore and when I tried to start VSCode I got a message saying my installation was corrupt. So I reinstalled to the latest version and now get this error.
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found...
I found 3 extensions that needed updating so I do so but did not fix this problem. Do not know if I need to update the .Net Core since it looks like a version mismatch. It seems these updates are wreckless since they always cause thing to go wrong.s
If you are facing this problem, it means you are using Windows.
This official microsoft live share github page explains how to fix the issue: https://github.com/MicrosoftDocs/live-share/issues/102
Especially, check out this comment: https://github.com/MicrosoftDocs/live-share/issues/102#issuecomment-366509735
make vscode is up to date
uninstall live share from vscode
close vscode completely
restart vscode as administrator
reinstall live share
I should add:
close completely vscode and restart it

How to resolve Pymongo Runtime Error R6034 in Houdini

I'm working at a visual effects studio in which we use MongoDB/pymongo for our asset management. Our studio is using the SideFX software Houdini.
So far MongoDB has been a pleasure to work with in terms of programming, however whenever we connect to the MongoDB via pymongo from within Houdini, we're getting the following error:
Microsoft Visual C++ Runtime Library - Runtime Error!
Program: C:\houdini\17.5.293\bin\houdini.exe
R6034
An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information.
This error occurs everytime when we import pymongo for the very first time, i.e. in a Python shell within Houdini, which is using Python 2.7. Once we click 'OK' on the error popup (it appears twice after clicking OK for the first time), the error disappears and we're able to connect successfully to the database.
The SideFX support team suggested that pymongo wasn't compiled with Visual Studio 2017, which is the compiler SideFX is using for their software.
Now we've been trying to debug this for a while now to no avail. Here's a rundown of what we tried:
update Windows10 to the latest and greatest
updating pymongo from 3.5.1 to 3.9.0
launching Houdini from different builds (16.5, 17.0, 17.5), we get the error in every version.(We're launching a vanilla Houdini session without any 'PYTHONPATH' or 'PATH' environment variables set)
interestingly enough my colleague imported pymongo into Houdini successfully on his private laptop last night without any errors occurring which leads me to believe that the error might be related to our system settings possibly?
I would love to find out how to get rid of this error message because it is really messing with our current pipeline. Any suggestions/help is welcome and much appreciated.
Please let me know if you need any additional information in order to debug this matter.
Thanks a lot in advance,
Manu
This post here helped me to resolve my issue:
Runtime error R6034 in embedded Python application
What happened is that we have a Python 2.7 install located at C:\Python27 which is being added as an environment variable 'path' in Windows.
Using the Process Explorer, I learned that this folder contains the file 'msvcr90.dll' which is conflicting with Houdini, since Houdini comes with its own Python installation that doesn't contain this dll file.
The solution is simple. When launching Houdini in a custom environment, strip the C:\Python27 from the 'path' environment variable so Houdini only fires up its own Python interpreter.

Getting "Error: Failed to connect to OmniSharp"

I'm trying to get VSCode working with my Unity projects, and every time I select the Project icon (the little fire at the bottom) I get the following error:
Error: Failed to connect to OmniSharp
Is anyone else getting this?
You need to download the most recent version of "mono". Open up terminal and pass in brew install mono. Then "Pick a project" and select the ..-csharp.sln file and you should be up and running.
Ok, made some progress and gotten a few Unity projects working. It seems that you need some prerequisites installed, a clean up of your Unity project folder, and possibly some hand editing of your .sln and .csproj files.
I posted a (possibly) better answer over on Reddit. Hope that's not breaking stack etiquitte.
http://www.reddit.com/r/Unity3D/comments/34d6gc/visual_studio_for_mac_help_us_vote_for_unity/
i get this on windows when my project directory has a space in it
i removed the space and removed the error
i expect it will be fixed soom
I have a completely different answer: it's the runtime that VSCode is using. It doesn't match up with what it thinks it needs. I have to remember that we're still in beta and that things are changing rapidly. I had my dnvm running beta 7, but VSCode (and OmniSharp, by extension) is looking for beta 6, so it was failing. I updated my runtime using this this post as a clue. Now I have VSCode 0.7.0 using the beta 6 runtime. I have no idea how to tell what it's looking for...I just guessed based on when they were both released. HTH

Pydev 3.0 + Eclipse + Google App Engine Debugging not working

I've been having problems getting debugging working with this setup for the past year. Supposedly, this is fixed in the latest versions, but I just can't seem to get it to work.
I'm using Mac OSX 10.8.5, Eclipse Keplar, PyDev 3.0.0, and Google App Engine 1.8.8.
I set up a run configuration to point to dev_appserver.py, running my project. That works fine. My python version is 2.7.3, and everything works in normal mode. When I try to run in debug mode, however, the app runs, the output specifically states:
pydev debugger: starting
pydev debugger: google app engine integration enabled
But after 20 seconds, the python process terminates with this error message:
'Launching New_configuration' has encountered a problem.
Timed out after 20.0 seconds while waiting for python script to connect.
Accept timed out
Execution works during those 20 seconds, because I can hit URLs connected to my app and see an effect. Breakpoints do not work, though. Is there something I need to do to get python to 'connect'?
Also - I should note that switching back to using 'old_dev_appserver.py' fixes this problem - debugging works fine when I do this. But, this is not really a solution, because I need to use the latest socket additions in the newer releases.
Thanks for any advice.
temporary solution:
edit the pydev_app_engine_debug_startup.py file:
eclipse/plugins/org.python.pydev_${VERSION}/pysrc/pydev_app_engine_debug_startup.py
change the line that reads:
if ':' not in config.version_id:
to:
if ':' not in config.version_id or config.version_id.startswith('default:'):
Looks like this is fixed in 1.9.0. I also had to make sure to update PyDev to the latest (3.3.3 at the time of this writing).
One more thing to add, and this one really tripped me up (on MacOS) -
In Eclipse, under Run -> Run Configurations, set the Main Module to point to this location:
/usr/local/google_appengine/dev_appserver.py
NOT the symlink:
/usr/local/bin/dev_appserver.py
Well, finally I found the answer. It is a Google's bug.
It has been reported and acknowledged.
see Debug is not working with PyDev again 1.8.8!
Update: Until the bug is fixed I am using PyCharm. The pro version has 30 days trial and works with GAE. It works like, well, a charm. I may even consider switching to it from Elicpse/PyDev
But I am used to JetBrains tools with Android Studio recnetly, and WebStorm and Resharper in the past, so I know to find my way around their IDEs. Your milage may and will vary.
Since the question, a new GAE has been released 1.8.9
Running GAE 1.8.9 with PyDev3.3.3 on Windows8.
This timeout issue still occurred.
When I entered the temporary workaround changes to pydev_app_engine_debug_startup described in the earlier answer, then the browser could not connect to the app.
However, on backing out this change, not only did the 'Launching New_configuration' not appear, but the breakpoints worked.
More info on the Python Tool Support for the App Engine Development Server is here
https://docs.google.com/document/d/1CCSaRiIWCLgbD3OwmuKsRoHHDfBffbROWyVWWL0ZXN4/edit