{"id":573,"hash":"0ad6a2c593e0ed530dc44b307f34fe1d8b7e4eacdcfe2bffccd426a505f18473","pattern":"Error while loading config - You appear to be using a native ECMAScript module configuration file","full_message":"This error is coming up when I am making a pull request. There is a GitHub workflow audit that runs checks on the pull request and it loads the test file from another repository.\n\n- name: Run Audits\n      run: npx jest audits/ch-2 --json --outputFile=audits/ch-2.json --noStackTrace\n\nTest suite failed to run\n\n    /Users/frankukachukwu/StudioProjects/covid-19-estimator-tksilicon-js/babel.config.js: Error while loading config - You appear to be using a native ECMAScript module configuration file, which is only supported when running Babel asynchronously.\n\nHow do I solve this issue?","ecosystem":"npm","package_name":"node.js","package_version":null,"solution":"TL;DR: Changing babel.config.<extension> to babel.config.cjs did the work. Check babel docs if you need a different config.\n\nThis 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.\n\nmodule.exports = {\n  presets: [\n    [\n      '@babel/preset-env',\n      {\n        targets: {\n          node: 'current'\n        }\n      }\n    ]\n  ]\n};\n\nAnd jest.config.cjs at the root too.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/61146112/error-while-loading-config-you-appear-to-be-using-a-native-ecmascript-module-c","votes":121,"created_at":"2026-04-19T04:51:22.571093+00:00","updated_at":"2026-04-19T04:51:27.268861+00:00"}