DonJayamanne / typescript-notebook

Run JavaScript and TypeScript in node.js within VS Code notebooks with excellent support for debugging, tensorflowjs visulizations, plotly, danfojs, etc
https://marketplace.visualstudio.com/items?itemName=donjayamanne.typescript-notebook
MIT License
904 stars 39 forks source link

Typescript doesn't seem to work. #79

Open 0xorial opened 1 year ago

0xorial commented 1 year ago

image

paustint commented 1 year ago

I have the same issue. It used to work perfectly, and I did not change anything and it suddenly stopped working out of no where on all my computers and all my projects no matter the setup.

I can run the code just fine and it works, but in the editor node_modules imports do not work.

image

The issue does not appear to be the same as these, since npm imports are broken and I am not attempting to do anything cross-cell.

https://github.com/DonJayamanne/typescript-notebook/issues/57 https://github.com/DonJayamanne/typescript-notebook/issues/74#issuecomment-1229406059

nthh commented 1 year ago

@paustint I had this issue with VSCode on both this repo's extension and tslab. I downgraded my VSCode to 1.78 and this seems to have resolved the issue

EDIT: Added a PR for VS Code to fix this https://github.com/microsoft/vscode/pull/186812

jermatic commented 1 year ago

I am having this issue

mmis1000 commented 10 months ago

It seems to be vscode's own bug.

The vscode use a virtual path to represent cells in a notebook file (you can see the virtual path in the log by enable "typescript.tsserver.log": "verbose" and open the log file mentioned in typescript extension output). https://github.com/microsoft/vscode/blob/f6bc90dc1f367dcd596209ae62add169b11845cf/extensions/typescript-language-features/src/typescriptServiceClient.ts#L714C76-L718

Which, unfortunately broke relative path.

Because the typescript language server would assume your file under other (relative path) places

圖片

And thus no relative path would work.

I wonder if change the vscode to append inMemoryResourcePrefix, scheme and authority in the file name instead will fix the path. But I have no experience to edit vscode itself. So I don't know how to test it yet.