f5 / unovis

Modular data visualization framework for React, Angular, Svelte, Vue, and vanilla TypeScript or JavaScript
https://unovis.dev
Apache License 2.0
2.17k stars 43 forks source link

No matching export in “d3-geo” for import “geoEqualEarth” error #436

Open tobychidi opened 1 month ago

tobychidi commented 1 month ago

I encountered an error while using the Unovis package in my Nuxt project. The error message indicates that there is no matching export for geoEqualEarth in the d3-geo package.

Error Message:

X [ERROR] No matching export in "node_modules/.pnpm/d3-geo@1.7.1/node_modules/d3-geo/index.js" for import "geoEqualEarth"

    node_modules/.pnpm/@unovis+ts@1.4.4/node_modules/@unovis/ts/components/topojson-map/types.js:1:138:
      1 │ ...eoOrthographic, geoStereographic, geoEqualEarth, geoAlbersUsa, geoAlbers, geoConicConformal, geoConic...

Additional Context: I have tried using this code in other Nuxt projects or on CodeSandbox without issues. I only see the issue in my main project. Need Help.

image

rokotyan commented 1 month ago

@tobychidi Your d3-geo package seems to be too old, maybe there is a conflicting dependency and this old version is getting installed for some reason. If you can share your package.json and the lock file, it can help to identify the problem.

You can also try adding d3-geo as an explicit dependency to your package.json, try version 3 or later.

tobychidi commented 1 month ago

You're right. I currently have turf installed. I ran pnpm why d3-geo and this is the result. Installing d3-geo explicitly fixed it.


dependencies:
@turf/turf 7.1.0
└─┬ @turf/buffer 7.1.0
  └── d3-geo 1.7.1
@unovis/ts 1.4.3-beta.0
├─┬ d3 7.9.0
│ └── d3-geo 3.1.1
└─┬ d3-geo-projection 4.0.0
  └── d3-geo 3.1.1
@unovis/vue 1.4.3-beta.0
└─┬ @unovis/ts 1.4.3-beta.0 peer
  ├─┬ d3 7.9.0
  │ └── d3-geo 3.1.1
  └─┬ d3-geo-projection 4.0.0
    └── d3-geo 3.1.1
d3 7.9.0
└── d3-geo 3.1.1