-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
asExternalUri doesn't work #1936
Comments
I'm not too familiar with |
Thanks for the response, I actually solved it from another direction. Instead of using iframe to the rendered graph url on the host, I took its html and embedded it into the webview. It works ok, you can close this issue. I believe soon I'll release this extension to be open source and then I'll need your help to get it into your extensions server |
Awesome, that sounds like a really good workaround. I'm thinking we should leave the issue open until we fix |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days. |
The Tabnine team is still facing this so we need to dig into it. |
If the work around is not working @code-asher @jsjoeio @Emyrk what are options for addressing this? |
I'm guessing @code-asher and I will need to add a patch to fix this then. |
To fully fix for the Tabnine case we will need:
|
Any updates on this issue? I’m still running into problems using TabNine on VS Code Web. |
Chatting with their team about this. Stay tuned! |
Dart & Flutter extension for VS Code uses asExternalUri too, and its DevTools iframes don't work without manual port forwarding, because it tries to connect to localhost. As far as I understand, it's related to this issue. |
Thanks for letting us know @Sominemo! That'll be helpful when we go to fix this. We may want to write our own extension that uses asExternalUri and add an e2e test to make sure it works (when we fix this). |
NotesI have started looking into this and will share my notes here and update this comment as I go. CONCLUSION: I successfully reproduced the bug. Investigation: does
|
I've identified the Root Cause as well and have an idea for fixing this. Root CauseBased on my findings, the call stack looks like this:
This last function -- "Okay...so shouldn't it throw this error?" You would think so but if you look at the link in 3 in my call stack list, you'll notice the code isn't wrapped in a "is that a bug?" I would say so but I might check with @code-asher. Raised upstream: microsoft/vscode#162770 There may be more to this root cause since I'm not sure why there wouldn't be a resolver for this external URI in the first place. I know it works in Codespaces but I can't figure out how. SolutionI'd like to discuss with @code-asher first but I did find this. When I add resolveExternalUri: async (uri: URI) => {
const v = await Promise.resolve(URI.parse("http://localhost:8080/proxy/8000"))
return v
}, then my extension uses it! If this is the correct place to patch, then next steps would be to agree upon how external uris should be resolved. One approach could be to use code-server's built-in proxy and do something like |
I chatted with @code-asher offline and we came up with a fix. I'm going to work on it today and hopefully push up a draft PR soon. Keep an eye out. |
Good news - PR is pretty much good to go. We should be able to wrap it up Monday assuming all goes well. |
Awesome. Thank you! |
Would you like me to try testing this? |
@ksylvan yes please! P.S. I should have time to clean up my PR today and merge 🤞🏼 |
What's the easiest way for me to test this? |
Good question! Easiest way that comes to mind:
That'll load code-server with the changes. Then you could try using any basic extension that uses |
|
Looks like my Debian instance wasn't updated to NodeJS16. Fixed that and now seeing this:
And then when I run it, I see:
|
Hmmm...I'm not sure why it's not installing on the modules. Here is one solution: #5530 (comment) You could also try with |
I see the new code with the proxy server auto-forwarding is in code-server, do you know what needs to happen with tabnine extension to use it? |
Hmm...I'd probably have to dig in but ideally they use // pseudo code
const serverURL = await vscode.asExternalUri("http://localhost:3000") |
Hi Guys,
I had written a new extension which renders Graphs from matplotlib into vscode webview component, it works great on vscode desktop, but I encounter problems when trying to work with it in code-server.
I cannot state what exactly the problem is but here is the workflow:
Any ideas what went wrong?
code-server --version
: v3.4.1The text was updated successfully, but these errors were encountered: