facebook / flow

Adds static typing to JavaScript to improve developer productivity and code quality.
https://flow.org/
MIT License
22.09k stars 1.86k forks source link

Dynamic Imports with static template strings throw an error #4208

Open STRML opened 7 years ago

STRML commented 7 years ago

For example:

async function fn(): Promise<void> {
  await import('http');
  await import(`https`);
}

throws:

Internal error: Context.Module_not_found(https)

Example

hackhat commented 7 years ago

In my case I have something like this: require('!!style-loader!css-loader!react-draft-wysiwyg/dist/react-draft-wysiwyg.css'); and the error is Internal error: Context.Module_not_found("!!style-loader!css-loader!react-draft-wysiwyg/dist/react-draft-wysiwyg.css")

hackhat commented 7 years ago

Getting it again with


require(`./myImage.jpg`)

It's only when I use template string to import.