Any way to set tsconfig.json or other properties?
Steps to reproduce
- Start Jupyter Lab in
/Users/yatharth/projectDir/ - Inside Jupyter Lab, create Typescript or Javascript notebook inside ``/Users/yatharth/projectDir/otherFolder`
- Inside notebook, try to do
import myFile as '../myFolder/myFile'
Expected Result
The import works.
Actual Result
There’s an error.
3:33 - File '/Users/yatharth/projectDir/myFolder/myFile.ts' is not under 'rootDir' '/Users/yatharth/projectDir/myFolder'
Implications
Can you really not import modules outside the current notebook’s directory? This seems surprising.
Potential solutions
It seems like the rootDir Typescript uses is set to the notebook’s directory. Maybe it would be better set to the initial directory that Jupyter Lab was started in or is serving from.
yo @yatharth have you had some workaround for this issue? apparently @yunabe will not work anymore in this repo.
yo @yatharth have you had some workaround for this issue?
No, I just start tslab in a higher director to avoid this.
apparently @yunabe will not work anymore in this repo.
Really? Where did they say that?
@yatharth i've found a cleaner workaround.
let's say you want to import from ./myFolder and you get the error you showed
then you can do:
cd node_modules
ln -s ../myFolder @myFolder
and later import from @myFolder (as it were a node package)
the script above will create a system link inside your node_modules folder
i've made lot's of tests with the tsconfig.json and tslab is apparently wholly ignoring it