gatsby-core-utils basicAuth issues - TypeError: Parameter auth
is deprecated. Use username
/ password
instead.
#32664
Labels
topic: core
Relates to Gatsby's core (e.g. page loading, reporter, state machine)
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
I've tried updating to the newest version of gatsby-source-drupal, which passes the file requests through gatsby-source-filesystem (createRemoteFileNode function) and to gatsby-core-utils (fetchRemoteFile function). I'm using basic auth for authentication, but during the "Downloading remote files from Drupal" step I'm getting the following error:
failed to process https://...
TypeError: Parameter
auth
is deprecated. Useusername
/password
instead.I've looked through the code, and it seems that the culprit is the way the http headers for basic auth are set and passed to "got" library. The culprit seems to be this line of code:
gatsby/packages/gatsby-core-utils/src/fetch-remote-file.ts
Line 184 in 1510091
Linking to related "got" options documentation: https://github.com/sindresorhus/got/blob/main/documentation/2-options.md#username
For testing purposes I went ahead and replaced the following code inside my node_modules:
with
and it seems to fix this issue.
Reproduction Link
Steps to Reproduce
Expected Result
Files should be downloaded without any issues.
Actual Result
info Downloading remote files from Drupal
ERROR
failed to process https://...
TypeError: Parameter
auth
is deprecated. Useusername
/password
instead.not finished source and transform nodes - 316.871s
failed Remote file download - 0.208s
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: