Accepted answer

topojson.feature takes two parameters, as seen in the topojson doc's:

topojson.feature(topology, object);

You have only specified the objects you wish to extract:

 let counties = topojson.feature(data[0].objects.counties);

The error likely derives from the lack of a second parameter: type is undefined for the second parameter since the second parameter is not defined.

Using both parameters, you can extract your features without error using both parameters below:

let counties = topojson.feature(data[0], data[0].objects.counties);

const promisses = [d3.json(''), d3.json('')];

Promise.all(promisses).then((d)=>{return processData(d)});

function processData(data) {
  for (let i = 0; i < data.length; i++) {
  let w = 800;
  let h = 0.6 * w;
  let padding = 40;
  let svg ='#chart-bg').append('svg');
  svg.attr('width', w + 2 * padding)
    .attr('height', h + 2 * padding)
  //The next line is where I am having trouble
  let counties = topojson.feature(data[0], data[0].objects.counties);
<script src=""></script>
<script src=""></script>

Related Query

More Query from same tag