3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

"moduleResolution": "bundler"がVSCodeでエラーになる

Posted at

はじめに

VSCodeでエラーが発生した際に解決に時間がかかったのでまとめます

問題

tsconfig.jsonの以下の箇所でエラーがでてしまいます

tsconfig.json
"moduleResolution": "bundler"

それが起因して、Reactのコードでもimportがうまくいかなくなっていました

エラーをみるとmoduleResolutionをnodeに変えろと言われました

解決方法

まずTypeScriptのバージョンが対応していなかったので変更しました

$ npm install -g typescript@latest

そしてVSCodeのバージョンがTypeScript5.0以降に対応していないことがわかったので更新しました

.debファイルをダウンロードしてインストールします

$ apt-get install インストールしたファイル.deb

これでエラーがでなくなりました

おわりに

私だけ周りと違う挙動をしていたので不安でしたが解決できてよかったです
このままエラーを表示したまま開発する選択肢を考えるほどでしたが一安心でした

参考

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?