I have a Nestjs application and I install the auth0 package. it works on my local Windows machine and ubuntu server with Node 20.6.0 but not working with Nodejs 18 or Node 20.9.0. I see the following stack trace:
The error showing the path auth0/src/lib/runtime.ts but on installing the auth0 package I get only dist folder. there is no src folder for auth0
ReferenceError: fetch is not defined
at new BaseAPI (/var/node/nestjs-demo/api/node_modules/auth0/src/lib/runtime.ts:34:44)\n
at new BaseAuthAPI (/var/node/nestjs-demo/api/node_modules/auth0/src/auth/base-auth-api.ts:97:5)
at new Database (/var/node/nestjs-demo/api/node_modules/auth0/src/auth/database.ts:120:1)
at new AuthenticationClient (/var/node/nestjs-demo/api/node_modules/auth0/src/auth/index.ts:18:21)
at new TokenProvider (/var/node/nestjs-demo/api/node_modules/auth0/src/management/token-provider.ts:23:33)
at new TokenProviderMiddleware (/var/node/nestjs-demo/api/node_modules/auth0/src/management/token-provider-middleware.ts:20:28)
at new ManagementClient (/var/node/nestjs-demo/api/node_modules/auth0/src/management/management-client.ts:73:9)
at new AuthService (/var/node/nestjs-demo/api/src/modules/auth/auth.service.ts:11:29)
at Injector.instantiateClass (/var/node/nestjs-demo/api/node_modules/@nestjs/core/injector/injector.js:365:19)
at callback (/var/node/nestjs-demo/api/node_modules/@nestjs/core/injector/injector.js:65:45)
Reproduction
Create a Nest js application
create a service to Initalise ManagementClient using domain, client id and secret params
Checklist
Description
I have a Nestjs application and I install the auth0 package. it works on my local Windows machine and ubuntu server with Node 20.6.0 but not working with Nodejs 18 or Node 20.9.0. I see the following stack trace:
The error showing the path
auth0/src/lib/runtime.ts
but on installing the auth0 package I get onlydist
folder. there is no src folder forauth0
Reproduction
Additional context
No response
node-auth0 version
4.3.1
Node.js version
20.6.0