4
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 3 years have passed since last update.

AWS Amplify エラー対処 Could not find a declaration file for module './aws-exports'.

Posted at

発生した問題

ファイル上ちゃんと存在するのに。aws-exports 見つからないとエラーが出る。
恐らく Typescript のエラーである。

Could not find a declaration file for module

    14 | import Amplify from "aws-amplify";
    15 | import "@aws-amplify/ui-vue";
  > 16 | import awsExports from "./aws-exports";
       |                        ^
    17 | Amplify.configure(awsExports);
    18 | 
    19 | new Vue({

#対処法

aws-exports を ts ファイルにしてあげれば良い。

ファイル名
aws-exports.jaaws-exports.ts

あと、キャメルケースにしないと怒られるのでケバブケースを使わないように注意

キャメルケース
import AwsExports from "./aws-exports";
ケバブケース
import aws-exports from "./aws-exports";
4
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
4
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?