Successfully merging a pull request may close this issue. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together. @jediboy_twitter. SyntaxError: Cannot use import statement outside a module This is one of the most common issue if you are trying to use ES6 features in your JavaScript project. hi Christian Bromann. There are a lot of reasons for the issue mentioned above to happen. Comments. 23 comments Labels. rm -rf node_modules and npm install (or yarn) should help.. BTW. index.js:1 Uncaught SyntaxError: Cannot use import statement outside a module index.html:11 Uncaught ReferenceError: AnimalApi is not defined at index.html:11 (anonymous) @ index.html:11.