Skip to content

Commit

Permalink
fix: native Promise.all doesn't handle non-iterables (#45)
Browse files Browse the repository at this point in the history
* fix: native Promise.all doesn't handle non-iterables

* one more instance

* actually Promise.all was good seems like it is nested promises await is needed?
  • Loading branch information
pieh authored and jbolda committed Jan 28, 2023
1 parent 6b23250 commit 5658ad5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/gatsby-source-airtable/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ exports.sourceNodes = async (
return processedData.childNodes;
});

let flattenedChildNodes = Promise.all(childNodes).then(nodes =>
let flattenedChildNodes = await Promise.all(childNodes).then(nodes =>
nodes.reduce(
(accumulator, currentValue) => accumulator.concat(currentValue),
[]
Expand Down Expand Up @@ -277,7 +277,8 @@ const localFileCheck = async (
});
// Adds a field `localFile` to the node
// ___NODE tells Gatsby that this field will link to another nodes
let localFiles = await Promise.all(fileNodes).map(
const resolvedFileNodes = await Promise.all(fileNodes);
const localFiles = resolvedFileNodes.map(
attachmentNode => attachmentNode.id
);
return localFiles;
Expand Down

0 comments on commit 5658ad5

Please sign in to comment.