microsoft / qsharp

Azure Quantum Development Kit, including the Q# programming language, resource estimator, and Quantum Katas
https://microsoft.github.io/qsharp/
MIT License
399 stars 80 forks source link

Q# create an Azure Quantum notebook not working in Codespaces #1133

Open xinyi-joffre opened 6 months ago

xinyi-joffre commented 6 months ago

Describe the bug

If I install the VSCode extension in GitHub codespaces using devcontainer, it installs it as a normal extension (not a "Browser - Installed" list). In this scenario, I can see the Q# commands, but when I click on "Q# create an Azure Quantum notebook", it errors out. If I choose to manually install it as a browser extension (not using devcontainer settings), refresh the page, then it works.

image

image

To Reproduce

Steps to reproduce the behavior:

  1. Open codespace such as: https://codespaces.new/microsoft/azure-quantum-python/tree/xinyi%2Fdevcontainer
  2. Wait for codespace to initialize
  3. Try to run command for "Q# create an Azure Quantum notebook"

Expected behavior

Expect that the command generates a notebook.

System information

minestarks commented 6 months ago

Hmmm, I suspect that installing the extension this way (into the container instead of the browser) just doesn't work since we're built as a web extension. I'm getting an activation failure and nothing is working, not just notebooks -

2024-02-08 13:35:19.723 [error] Activating extension quantum.qsharp-lang-vscode failed due to an error:
2024-02-08 13:35:19.723 [error] Error: 
    at R.vb (../../../vs/workbench/api/worker/extensionHostWorker.js:108:48266)
    at async Promise.all (index 0)
    at async n (../../../vs/workbench/api/worker/extensionHostWorker.js:95:6256)
    at async n.m (../../../vs/workbench/api/worker/extensionHostWorker.js:95:6219)
    at async n.l (../../../vs/workbench/api/worker/extensionHostWorker.js:95:5676)

I think @billti has a more better understanding of the extension architecture here... is there anything we can do to get around it, or does the user have to install our extension from the browser?

@xinyi-joffre the Q# extension comes preinstalled at https://vscode.dev/quantum/ - I don't know what your goals are but I wonder if just going to that URL and connecting to the Codespace would be an acceptable experience?

billti commented 6 months ago

Ugh. There are just so many permutation of this setup. I've tested codespace, and containers, and browser installs, and using Jupyter Notebooks in them (and that widgets work etc.). But maybe I didn't try this combo, or maybe something broke across releases (ours or VS Code). I'll give it a shot when I get a chance and report back.