You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to implement a bubble map chart in React, using the example of Mercator projection. However, I got errors about cannot find geoMercator all the time. I imported d3 by npm but got the error of function missing. I tried d3-geo, and d3-geo-projection but none of them works. As a newbie of React any help is appreciated!
Error:
WorldMap.js:61 Uncaught (in promise) TypeError: _d2.default.geoMercator is not a function
Code:
`import $ from 'jquery';
import ReactFauxDOM from 'react-faux-dom';
import firebase from 'firebase';
import React from 'react';
import d3 from 'd3';
import d3geo from 'd3-geo-projection';
import topojson from 'topojson';
class WorldMap extends React.Component {
constructor(props) {
super()
}
This looks like an import error, but I can’t say whether it was just your attempt to import the default export that doesn’t exist, or if there is a problem with your React toolchain configuration such that it’s not importing from the package.json’s defined module entry (rather than the main entry which points to the Rollup-generated ES5 bundle which is strongly not recommended for ES6 and later environments).
I was trying to implement a bubble map chart in React, using the example of Mercator projection. However, I got errors about cannot find geoMercator all the time. I imported d3 by npm but got the error of function missing. I tried d3-geo, and d3-geo-projection but none of them works. As a newbie of React any help is appreciated!
Error:
Code:
`import $ from 'jquery';
import ReactFauxDOM from 'react-faux-dom';
import firebase from 'firebase';
import React from 'react';
import d3 from 'd3';
import d3geo from 'd3-geo-projection';
import topojson from 'topojson';
class WorldMap extends React.Component {
constructor(props) {
super()
}
}
export default WorldMap;
`
The text was updated successfully, but these errors were encountered: