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

Expo React Native SVG Error #1613

Open bendrobinson1998 opened 9 months ago

bendrobinson1998 commented 9 months ago

Bug summary

When installing SHOPIFY Polaris viz native in a expo project, the React Native SVG included in the node modules of Polaris-viz-native clashes with the package included by default with expo.

Expected behavior

No clashes

Actual behavior

App fails on build time quoting a RNSVG error, short term solution is to add react native svg to resolutions in package.json.

Steps to reproduce the problem

  1. Install shopify polaris viz native in a fresh expo project, add a chart and run build.
markmssd commented 6 months ago

Hey @bendrobinson1998 , were you able to fix your issue?

bendrobinson1998 commented 6 months ago

Hey @bendrobinson1998 , were you able to fix your issue?

Hi, I am still deleting the react-native-svg folder from the node_modules of the @shopify/polaris-viz-native directory before building, this works.

markmssd commented 6 months ago

Well I'll be damned, it worked! I guess that dependency should be added as a peer dependency instead, thanks so much @bendrobinson1998 🚀

markmssd commented 6 months ago

Btw, to avoid having to delete react-native-svg from node_modules manually, you can put this in your package.json file instead

  "resolutions": {
    "@shopify/polaris-viz-native/react-native-svg": "15.1.0"
  }