[flow] The parameter passed to require() must be a literal string
See original GitHub issueWith 0.4.4 version.
if (state.opts.plugins) {
const pluginsVisitors = state.opts.plugins.map((pluginName) => {
const plugin = require(pluginName);
return plugin({ template, types }).visitor;
});
programPath.traverse(visitors.merge(pluginsVisitors));
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:9 (5 by maintainers)
Top Results From Across the Web
The parameter passed to require() must be a literal string. #2946
I am having this problem, i assume caused by using a backtick string template in the webpack require function: 3: const Vue ...
Read more >[flow] The parameter passed to require() must be a literal string
With 0.4.4 version. if (state.opts.plugins) { const pluginsVisitors = state.opts.plugins.map((pluginName) => { const plugin = require(pluginName); return ...
Read more >require() must have a single string literal argument React Native
The solution there if you have more than 2 choices is to pass the result of the require as a parameter instead of...
Read more >Variable reference in Switch Case parsed as string...
I have a very complex flow with 70 branches formed from nested switch ... Only a literal of type string or interger or...
Read more >Handbook - Literal Types - TypeScript
Using literal types with TypeScript. ... and booleans; by using literal types you can allow an exact value which a string, number, or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Regarding the why of this new lines of code, it can be summarized with that tweet.
I have been adding that line to the
.flowconfigfile. The best solution I could find.Worst case if you want to solve it in this repo you can add
// $FlowFixMeabove the line in question.