8
5

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 で LIFF を使ってUserIDを取得する

Posted at

LIFF( https://www.npmjs.com/package/@line/liff )でwindowが使われているので普通にimport liff from '@line/liff'とすると怒られます。思いついた選択肢は、

  1. next/dynamic( https://nextjs.org/docs/advanced-features/dynamic-import )でなんとかする。
  2. useEffectimport('@line/liff')する。
  3. npmパッケージを使うのは諦めて、_documentでCDNから落とす。

今回は2でやってみました。

8
5
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
8
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?