0
0

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.

Next.jsでbuildすると、AmplifyのAuth.configureがnullになるとき

Posted at

結論

Amplify.configure({...awsconfig})
+ Auth.configure({...authconfig})
- Amplify.Auth.configure({...authconfig}) // Amplify.Auth is null

概要

納期が迫っているのでギリギリで書いていますのでサクッと

Next.js + Amplifyの構成でCognitoへのログインなどを実装している場合に
yarn dev では動くのに yarn build && yarn start では突然大量のエラーが出て絶望していた

Amplifyの中身をログ出力すると、いろんなものがnullになっており、より怖い
ファイルの場所変えたりとか色々試してみるも、結局は Auth.configure を直接呼ぶ形にすることで解決できた

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?