You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The downside is that you lose compile-time checking of import syntax. In ESM you are required to put file extensions (import { thing } from './myFile.js), however, Bundler allows you to just put ./myFile. So your code will compile without error, but you will still get an error at runtime because of lack of extension.
This might not be the only undesirable effect of using this setting. Ideally the types should be working just fine when using Node16/NodeNext.
The text was updated successfully, but these errors were encountered:
Steps to reproduce
kubo-rpc-client
as dependency and the followingtsconfig.json
:NodeNext
also does the thing)Expected
I should get proper typings when importing the library
Actual
Everything is resolving as
any
and VSCode autocomplete doesn't workVersion Info
kubo-rpc-client
version3.0.1
VSCode version
1.81.1
Typescript version
5.1.6
node version
18.17.0
Screenshots
Workaround
A possible workaround for now is to change the
moduleResolution
toBundler
:The downside is that you lose compile-time checking of import syntax. In ESM you are required to put file extensions (
import { thing } from './myFile.js
), however,Bundler
allows you to just put./myFile
. So your code will compile without error, but you will still get an error at runtime because of lack of extension.This might not be the only undesirable effect of using this setting. Ideally the types should be working just fine when using
Node16
/NodeNext
.The text was updated successfully, but these errors were encountered: