DevExpress / devextreme-reactive

Business React components for Bootstrap and Material-UI
https://devexpress.github.io/devextreme-reactive/
Other
2.07k stars 376 forks source link

Error after installing version 3.0.6 #3585

Closed akhnaz closed 1 year ago

akhnaz commented 1 year ago

Hello,

With yesterday update (version 3.0.6), i got the following error when build. Previously, i am using version 3.0.5.

Error [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/d3-scale/src/index.js from /app/node_modules/@devexpress/dx-chart-core/dist/dx-chart-core.umd.js not supported.
Instead change the require of index.js in /app/node_modules/@devexpress/dx-chart-core/dist/dx-chart-core.umd.js to a dynamic import() which is available in all CommonJS modules.
    at /app/node_modules/@devexpress/dx-chart-core/dist/dx-chart-core.umd.js:9:106
    at Object.<anonymous> (/app/node_modules/@devexpress/dx-chart-core/dist/dx-chart-core.umd.js:12:2)
    at /app/node_modules/@devexpress/dx-react-chart/dist/dx-react-chart.umd.js:9:141
    at Object.<anonymous> (/app/node_modules/@devexpress/dx-react-chart/dist/dx-react-chart.umd.js:12:2)
    at Object.<anonymous> (/app/node_modules/@devexpress/dx-react-chart-material-ui/dist/dx-react-chart-material-ui.cjs.js:19:20)
    at Object.22357 (/app/.next/server/pages/system/enquiry/enquiries.js:48:52)
    at __webpack_require__ (/app/.next/server/webpack-runtime.js:25:42)
    at __webpack_exec__ (/app/.next/server/pages/system/enquiry/enquiries.js:734:39)
    at /app/.next/server/pages/system/enquiry/enquiries.js:735:181
    at Function.__webpack_require__.X (/app/.next/server/webpack-runtime.js:108:21)
    at /app/.next/server/pages/system/enquiry/enquiries.js:735:47
    at Object.<anonymous> (/app/.next/server/pages/system/enquiry/enquiries.js:738:3)
    at Object.requirePage (/app/node_modules/next/dist/server/require.js:58:12)
    at /app/node_modules/next/dist/server/load-components.js:61:73
    at async Object.loadComponents (/app/node_modules/next/dist/server/load-components.js:61:26)
    at async /app/node_modules/next/dist/build/utils.js:798:32
    at async Span.traceAsyncFn (/app/node_modules/next/dist/trace/trace.js:79:20) {
  code: 'ERR_REQUIRE_ESM'
}
Krijovnick commented 1 year ago

Hi @akhnaz,

Devextreme Reactive switched to a new version of d3 modules. They are ESM modules only. Therefore, you also need to switch to ESM and update package.json.

Lugribossk commented 1 year ago

Does that mean that Devextreme Reactive is now also ESM only? Will you then be removing the UMD build and setting type=module in package.json?

ipbyrne commented 1 year ago

This is also happening to me using NextJS with TypeScript.

None of the versions between 3.0.0-3.0.6 seem to work in NextJS type script.

noverby commented 1 year ago

Any workaround for this?

github-actions[bot] commented 1 year ago

Thank you for using Devextreme Reactive. We use GitHub issues to track bug and feature requests. We process incoming issues as soon as possible. Issues that have been inactive for 30 days are closed. If you have an active DevExtreme license, you can contact us in our Support Center for updates. Otherwise, post your question on StackOverflow.