After the update from antd 4.2.5 to antd 4.3.0 the application starts breaking after building on the staging env.
Meteor Version 2.7.3
In local development everything is fine.
meteor --production works fine as well.
Only after the build when deploying the app to our staging env the docker-container crashes with the following error:
/webapp/programs/server/node_modules/fibers/future.js:280
20.6.2022 13:24:50 throw(ex);
20.6.2022 13:24:50 ^
20.6.2022 13:24:50
20.6.2022 13:24:50 Error [ERR_REQUIRE_ESM] [ERR_REQUIRE_ESM]: Must use import to load ES Module: /webapp/programs/server/npm/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
20.6.2022 13:24:50 require() of ES modules is not supported.
20.6.2022 13:24:50 require() of /webapp/programs/server/npm/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js from /webapp/programs/server/npm/node_modules/rc-notification/es/useNotification.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
20.6.2022 13:24:50 Instead rename toConsumableArray.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /webapp/programs/server/npm/node_modules/@babel/runtime/helpers/esm/package.json.
20.6.2022 13:24:50
20.6.2022 13:24:50 at new NodeError (internal/errors.js:322:7)
20.6.2022 13:24:50 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1102:13)
20.6.2022 13:24:50 at Module.load (internal/modules/cjs/loader.js:950:32)
20.6.2022 13:24:50 at Module.Mp.load (/webapp/programs/server/runtime.js:46:33)
20.6.2022 13:24:50 at Function.Module._load (internal/modules/cjs/loader.js:790:12)
20.6.2022 13:24:50 at Module.require (internal/modules/cjs/loader.js:974:19)
20.6.2022 13:24:50 at Module.moduleLink [as link] (/webapp/programs/server/node_modules/@meteorjs/reify/lib/runtime/index.js:52:22)
20.6.2022 13:24:50 at Object.<anonymous> (/webapp/programs/server/npm/node_modules/rc-notification/es/useNotification.js:1:27)
20.6.2022 13:24:50 at Module._compile (internal/modules/cjs/loader.js:1085:14)
20.6.2022 13:24:50 at Module.Mp._compile (/webapp/programs/server/runtime.js:99:23)
20.6.2022 13:24:50 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
20.6.2022 13:24:50 at Module.load (internal/modules/cjs/loader.js:950:32)
20.6.2022 13:24:50 at Module.Mp.load (/webapp/programs/server/runtime.js:46:33)
20.6.2022 13:24:50 at Function.Module._load (internal/modules/cjs/loader.js:790:12)
20.6.2022 13:24:50 at Module.require (internal/modules/cjs/loader.js:974:19)
20.6.2022 13:24:50 at Module.moduleLink [as link] (/webapp/programs/server/node_modules/@meteorjs/reify/lib/runtime/index.js:52:22) {
20.6.2022 13:24:50 code: 'ERR_REQUIRE_ESM'
20.6.2022 13:24:50 }
After reading:
and
Am I correct to assume that babel-plugin-transform-es2015-modules-reify in meteor build causes this error ?
Or has the handling of esm modules changed since 2017 ?
A similar error basing on a different antd component also appears on later antd versions.
The newest version of material-ui builds without any problem. But I would like to avoid having to change our whole component framework.
Any help or guidance to find a solution is greatly appreciated.