I am having the same issue, i'm using CRA, don't know what to do. I have tried most of the suggestions made here. SyntaxError: Cannot use import statement outside a module In Jest configuration, testPathIgnorePatterns, transformIgnorePatterns, Using .babel.config.js instead of .babelrc.js. . Since esbuild supports ES6, it would work. When I used sequelize migrations with npx sequelize db:migrate, I got this error, so my solution for this was adding the line require('@babel/register'); into the .sequelizerc file as the following image shows: Be aware you must install Babel and Babel register. In my tsconfig.json. What are the advantages of running a power tool on 240 V vs 120 V? Can my creature spell be countered if I cast a split second spell after it? For those who were as confused as I was when reading the answers, in your package.json file, add Plot a one variable function with different values for parameters? Jest - SyntaxError: Cannot use import statement outside a module . Inside these files I am using es6 modules. Not the answer you're looking for? How about saving the world? Not the answer you're looking for? SyntaxError: Cannot use import statement outside a module. You may want to check that you are also mapping your .js files to a transformer.. For example, if you are using TypeScript, the transform property of your jest.config.js should look like : I have read a million stackoverflow and github issue threads. However, this does not work for me. Why not upload images of code/errors when asking a question? @blu10 it just didn't work for me I guess, OP didn't try to make it work for typescript, This worked for me when I got the error on an import statement for the node module. You can interpret individual files as CommonJS by using the .cjs extension. To solve the error, transform your test files with ts-jest before running