Categories
Mastering Development

Upgrading Node JS and ERR_REQUIRE_ESM: Must use import to load ES Module: ‘inheritsloose.js’ of Babel Runtime

The following error is emitted in my Node JS/React JS application after upgrading Node JS to v.12. I’m currently using @babel/core 7.10.1. How should this error be resolved? Here is my babel.config.js: module.exports = { presets: [ [ ‘@babel/preset-env’, { targets: { node: ‘current’, }, }, ], ‘@babel/preset-react’, ‘@babel/preset-typescript’, ], plugins: [ ‘@babel/plugin-proposal-class-properties’, [‘@babel/plugin-proposal-decorators’, { […]