Shopify / polaris-viz

A collection of React and React native components that compose Shopify's data visualization system
https://polaris-viz.shopify.com
Other
322 stars 23 forks source link

require() of ES Module not supported #1425

Open ahmed-adly-khalil opened 1 year ago

ahmed-adly-khalil commented 1 year ago

Bug summary

adding polaris vis to Next JS 13 project not working

Expected behavior

to work normally

Actual behavior

getting the below error

Error: require() of ES Module .../node_modules/d3-scale/src/index.js from /.../node_modules/@shopify/polaris-viz-core/build/cjs/utilities/createGradient.js not supported. Instead change the require of index.js in.../node_modules/@shopify/polaris-viz/node_modules/@shopify/polaris-viz-core/build/cjs/utilities/createGradient.js to a dynamic import() which is available in all CommonJS modules.

Steps to reproduce the problem

install in nextJS 13 project

Reduced test case

install in nextJS 13 project

Specifications