I'm trying to set up my nodejs backend functions to use Auth0 for IAM services.
I can successfully deploy functions to my IBM Cloud account that don't uses auth0 library, but if I try to upload a function that uses auth0 library I receive the following error:
error: Unable to create action 'function_name': The request content was malformed: Unexpected end-of-input at input index 1394034 (line 1, position 1394035), expected '"':
I've tried to use externals in my webpack.config.js file:
// webpack.config.js
externals: {
auth0: "commonjs auth0"
}
// mycode.js
const ManagementClient = require('auth0').ManagementClient;
and I can successfully deploy the function but when I call the endpoint I receive this error:
(0 , r(...).ManagementClient) is not a constructor
- I'm using webpack v5.0.0 and tried also with v4.x.x
- Auth0 library: https://github.com/auth0/node-auth0