Error while loading config – You appear to be using a native ECMAScript module configuration file (Jest)

TLDR – Changing bable.config.<extension> to bable.config.cjs did the work. Check bable docs if you need a different config.

SOLVED: For anyone who encounters this problem. This has got to do with Babel settings. The use of .mjs, cjs or js extension for the babel.config.extension. In my case where I was running LTE Node 12.6.2. I needed this configuration at the root of my directory babel.config.cjs. cjs is what is applicable for Nodejs when using “type”=”module”. See more about it here on babel docs.

module.exports = {
  presets: [
    [
      '@babel/preset-env',
      {
        targets: {
          node: 'current'
        }
      }
    ]
  ]
};

And jest.config.cjs at the root too.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)