Closed ronfor closed 7 months ago
@ronfor The Node.js docs state that fetch
global (and FormData
) should be available unflagged from v18.0.0 so the error you're getting is quite surprising.
Are you running your application in an environment that potentially customises the runtime in anyway?
Yes the --no-experimental-fetch
was set without my knowledge. Thanks!
I was on Node 16 which does not have fetch
installed globally. Upgrading to Node 20 worked, thanks!
Checklist
Description
When Fetch is NOT supplied
The native fetch does not appear to be picked up when using Node v18. I see the following stacktrace:
Managment client defined like so:
And API call:
When Fetch IS supplied
If I do specify the fetch override I see the following error:
ReferenceError: FormData is not defined at UsersManager.createFetchParams (/var/task/index.js:239366:44) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async UsersManager.request (/var/task/index.js:239335:27) at async UsersManager.update (/var/task/index.js:243945:22)
Managment client defined like so:
Reproduction
Additional context
No response
node-auth0 version
4.3.1
Node.js version
18