LoginSignup
0
0

More than 5 years have passed since last update.

Flowに「The parameter passed to require() must be a literal string.」と怒られた時

Posted at

やろうとしたこと

requireの引数に変数を渡してファイルを読み込もうとした。

const xxxPath = '...';
require(xxxPath);

解決

optionsmodule.ignore_non_literal_requires=trueを設定する。

.flowconfig
[options]
module.ignore_non_literal_requires=true
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