Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module '[email protected]' on newly created tenants #163

Open
adamjmcgrath opened this issue Aug 22, 2023 · 6 comments · May be fixed by #166
Open

Cannot find module '[email protected]' on newly created tenants #163

adamjmcgrath opened this issue Aug 22, 2023 · 6 comments · May be fixed by #166

Comments

@adamjmcgrath
Copy link

The account linking extension is failing on newly created tenants - I suspect that it does not work on the Node 18 runtime

Steps to reproduce:

  • Create a tenant
  • Install the "Auth0 Account Link" extension
  • Open the "auth0-account-link-extension" rule and click "Save and Try" and then "Try"
  • The rule fails with:
ERROR: Cannot find module '[email protected]'
Require stack:
- /data/io/node18/8e88feb3-2f75-48a2-8a40-e54c2844983a/webtask.js

Raised by customers in auth0/nextjs-auth0#1384 and https://community.auth0.com/t/auth0-account-link-error-with-importing-modules/114153

@armando-herastang
Copy link

armando-herastang commented Aug 22, 2023

Hi @adamjmcgrath , I'm the OP here https://community.auth0.com/t/auth0-account-link-error-with-importing-modules/114153

This, and other issues are bothering regarding this extension. I don't know if someone is monitoring this repo since rules are being deprecated next year. I guess at some point Auth0 will publish an Action to achieve this feature.

I'll post this on the thread later, but I managed to work around:

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

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

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

Hope this helps.

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

@adamjmcgrath
Copy link
Author

@zeelmodi-simform ☝️ fyi

Thanks for sharing the workaround @armando-herastang

@zeelmodi-simform
Copy link

@armando-herastang @adamjmcgrath Thanks for the help!

ADTC added a commit to ADTC/auth0-account-link-extension that referenced this issue Oct 2, 2023
@ADTC ADTC linked a pull request Oct 2, 2023 that will close this issue
@cowst
Copy link

cowst commented Oct 31, 2023

I am not sure where this is happening, since I am not sure where Rules are, so I was not able to apply the workaround.
I had to select node 16 to have it working.

@medAzizRezgui
Copy link

I am having the same issue, I removed the extension, still getting the "Cannot find module" Error.
I can't even find the rule to maybe remove it or something.

@erok415
Copy link

erok415 commented Mar 12, 2024

I found that if you have a new tenant account and you're experiencing this, it's most likely because you're tenant is using Node 18. To find out and fix this problem like I did, go to your Tenant Account Settings page by clicking Setting under your account in the top right of the screen, go to Advanced, scroll to the bottom and make sure you're Runtime is on Node 16 not Node 18. Save once you've changed to Node 16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants