LoginSignup
1

More than 5 years have passed since last update.

【flow】packageがmodule not found【monorepo】

Last updated at Posted at 2018-07-25

monorepo環境にflowを導入した場合、
packagesをrequireで参照したときにmodule not found.が発生する

import { hoge } from 'package-name/sample';

対処方法

flow-typed create-stub {package-name}

flow-typedがない人は yarn global add flow-typed

CLI Commands and Flags - create-stub

上記コマンドにて、packageの型定義ファイルが生成されるので、flowはその定義ファイルを参照してくれるようになる。

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