When I import React and ReactJs DOM, it's showing an error: Uncaught SyntaxError: Cannot use import statement outside a module … Cannot use import statement outside a module 错误原因很复杂,这里不表。 我这里是使用了ramda/es 目录下的文件导致的,es目录下是export import 导出 导入的。 this is very frustrating. Uncaught SyntaxError: Cannot use import statement outside a module. By clicking “Sign up for GitHub”, you agree to our terms of service and Still, it wasn't too difficult to figure out that the syntax was invalid because it was treated as pure JavaScript.