DonJayamanne/typescript-notebook

Relative imports work during execution but not when editing

Opened this issue · 0 comments

In a typescript notebook cell, if I have code like:

import { main } from './my-module';
main();

Where my-module.ts is a sibling file to the notebook, typescript is unable to resolve the module at edit time. Executing the cell works fine.

For some reason, something like this works at edit-time, but fails obviously at evaluation:

import { main } from '../../../../../../my-module';
main();

I don't remember the exact number of ../s required, but typescript seems to think the "current" module is deeply nested in the workspace somewhere.