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

import is unavailable in the next cell #74

Open samuelstroschein opened 2 years ago

samuelstroschein commented 2 years ago

Importing a package works as expected in the cell where the import is defined. However, typescript lints in following cells that the import is unavailable and upon execution, a crash occurs.

Related to https://github.com/DonJayamanne/typescript-notebook/issues/12?

image
samuelstroschein commented 2 years ago

Assigning the import to a variable does not crash the following cell. TypeScript still complains though.

image
samuelstroschein commented 1 year ago

The issue exists in multiple jupyter related repositories.

https://github.com/yunabe/tslab/issues/56 https://github.com/microsoft/vscode/issues/130000

A workaround is const tslab = require("tslab") as typeof import('tslab')

DonJayamanne commented 1 year ago

thanks for filling this issue, and sorry You're thinking into this. unfortunately this is a bug in the typescript language server. they don't support notebooks