Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gatsby-source-contentful] retry fails due to undefined reporter #31590

Closed
njbmartin opened this issue May 25, 2021 · 2 comments
Closed

[gatsby-source-contentful] retry fails due to undefined reporter #31590

njbmartin opened this issue May 25, 2021 · 2 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. topic: source-contentful Related to Gatsby's integration with Contentful type: bug An issue or pull request relating to a bug in Gatsby

Comments

@njbmartin
Copy link
Contributor

In the following function, if reporter is undefined, any retries will result in an error being thrown and the file failing to be downloaded, which isn't reported back to the console, but results in this error behing thrown instead: [gatsby-source-contentful] Please install gatsby-plugin-sharp

function getAxios(reporter) {
if (!RetryAxios) {
RetryAxios = axios.create()
RetryAxios.defaults.raxConfig = {
instance: RetryAxios,
onRetryAttempt: err => {
const cfg = rax.getConfig(err)
reporter.verbose(
`Retry attempt #${cfg.currentRetryAttempt} for ${err.config.url}`
)
},
}
rax.attach(RetryAxios)
}
return RetryAxios
}

The downloadWithRetry function expects reporter to be passed in...

export default async function downloadWithRetry(requestConfig, reporter) {

But, in the two places it's actually used, reporter isn't passed in:

downloadWithRetry({
url: previewUrl,
responseType: `stream`,
})

const imageResponse = await downloadWithRetry({
url: requestUrl,
responseType: `arraybuffer`,
})

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 25, 2021
@LekoArts LekoArts added topic: source-contentful Related to Gatsby's integration with Contentful type: bug An issue or pull request relating to a bug in Gatsby and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels May 26, 2021
@github-actions
Copy link

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Jun 15, 2021
@github-actions
Copy link

Hey again!

It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 💪💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. topic: source-contentful Related to Gatsby's integration with Contentful type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

2 participants