1
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?

[GitHub Actionsエラー] An import path can only end with a '.tsx' extension when 'allowImportingTsExtensions' is enabled.

Posted at
error TS5097: An import path can only end with a '.tsx' extension when 'allowImportingTsExtensions' is enabled.

GitHub ActionsでCICDが実行された際に上記のエラーが発生しましたので解決法を紹介します。

原因

tsxファイルをインポート時に.tsxを記述していたのが原因でした。

- import Component from "./Component.tsx"; // 拡張子が付いているのが原因
+ import Component from "./Component";

まとめ

GitHub Copilotの予測変換を使っているとたまに余計な記述で失敗することがあったりします。

コーディングしている際の警告はしっかり読んでいきたいと思います。

1
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
1
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?