Auth0 Account Link error with importing modules

Hi

I am trying to use the Auth0 Account Link extension. And can’t seem to get it working. I know rules are being deprecated, but for now, I am good, until I need to switch. I need this feature right now.

The thing is I have it working in a different account for a while. I’m trying to set it here and I keep getting an error (I followed the tutorial / documentation).

The error is as follow:

Script generated an unhandled asynchronous exception. Error code: MODULE_NOT_FOUND

Error: Cannot find module 'request@2.56.0

It appears so that it is using node18 because I see /data/io/node18/ at some directory prefix.

Can someone help me out. I’ve been struggling with this for quite a while.

Thanks in adavance!

1 Like

Manage to workaround this (other issues comes up)

function (user, context, callback) {
  /**
   * This rule has been automatically generated by
   * Unknown at 2023-08-21T18:29:51.731Z
   */
  //Removed: var request = require('request@2.56.0');
  var jwt = require('jsonwebtoken'); //Removed version targeting
  var queryString = require('querystring');
  var Promise = require('native-or-bluebird@1.2.0');

  var CONTINUE_PROTOCOL = 'redirect-callback';
  //...

Apparently request is embedded in the runtime environment, and jsonwebtoken will resolve needed/“working” versions.

Hope this helps. If anyone has any clue why is this happening (since still not deprecated), please reply

Will create a new thread and new issue with my other issue.

UPDATE: In the case of request you can just remove the version targeting and leave the line as

var request = require('request');
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.