AndreasFaust / gatsby-source-custom-api

Source data from any API and transform it to (File-)Nodes.
52 stars 25 forks source link

Username is not defined #36

Closed jdahdah closed 2 years ago

jdahdah commented 2 years ago

There seems to be an issue with the new auth object. It's supposed to be optional, but if I look at the line in the PR, there is no check whether that object is actually provided or not.

This is resulting in the following error and breaking the plugin before it manages to download anything.

TypeError: Cannot read property 'username' of undefined
    at createImageNodes
(/Users/home/Development/test/node_modules/gatsby-source-custom-api/utils/loadImages.js:21:35)
    at /Users/home/Development/test/node_modules/gatsby-source-custom-api/utils/loadImages.js:96:14
    at runNextTicks (node:internal/process/task_queues:61:5)
    at processImmediate (node:internal/timers:437:9)
    at async Promise.all (index 5)
    at Object.exports.sourceNodes
(/Users/home/Development/test/node_modules/gatsby-source-custom-api/gatsby-node.js:47:14)
    at runAPI (/Users/home/Development/test/n
cdennington commented 2 years ago

Trying to install via NPM, Its saying 2.3.2 is the latest and this issue is still present:

image

If this was fixed in 2.3.3, how can I upgrade?

jdahdah commented 2 years ago

Indeed it looks like v2.3.3 was never published to npm.