typescript-notebook icon indicating copy to clipboard operation
typescript-notebook copied to clipboard

import is unavailable in the next cell

Open samuelstroschein opened this issue 3 years ago • 3 comments

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 avatar Aug 27 '22 09:08 samuelstroschein

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

image

samuelstroschein avatar Aug 27 '22 09:08 samuelstroschein

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')

samuelstroschein avatar Aug 28 '22 08:08 samuelstroschein

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

DonJayamanne avatar Sep 02 '22 11:09 DonJayamanne