I’m following the Spotify Client Credentials Auth Guide and keep getting this error.
ERROR: str.replace is not a function
TypeError: str.replace is not a function
at Querystring.rfc3986 (C:\Users\malga\AppData\Roaming\npm\node_modules\n8n\node_modules\request\lib\querystring.js:43:14)
at Request.json (C:\Users\malga\AppData\Roaming\npm\node_modules\n8n\node_modules\request\request.js:1287:30)
at Request.init (C:\Users\malga\AppData\Roaming\npm\node_modules\n8n\node_modules\request\request.js:406:10)
at Request.RP$initInterceptor [as init] (C:\Users\malga\AppData\Roaming\npm\node_modules\n8n\node_modules\request-promise-core\configure\request2.js:45:29)
at new Request (C:\Users\malga\AppData\Roaming\npm\node_modules\n8n\node_modules\request\request.js:127:8)
at Object.request (C:\Users\malga\AppData\Roaming\npm\node_modules\n8n\node_modules\request\index.js:53:10)
at Object.execute (C:\Users\malga\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-nodes-base\nodes\HttpRequest.node.ts:747:35)
at Workflow.runNode (C:\Users\malga\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-workflow\src\Workflow.ts:1127:28)
at C:\Users\malga\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\WorkflowExecute.ts:597:41
at C:\Users\malga\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\WorkflowExecute.ts:692:6
This is my HTTP Request Node json
{
"parameters": {
"requestMethod": "POST",
"url": "https://accounts.spotify.com/api/token",
"options": {},
"bodyParametersUi": {
"parameter": [
{
"name": "grant_type",
"value": "client_credentials"
}
]
},
"headerParametersUi": {
"parameter": [
{
"name": "Authorization",
"value": "Basic 08505f64474e4de0a0e57c2e1bfe1517:0b178174dc9e40eaa146093c03bb18d1"
},
{
"name": "Content-Type",
"value": "application/x-www-form-urlencoded"
}
]
}
},
"name": "HTTP Request1",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
850,
290
]
}
Any idea what might be wrong?