Missing Module Error Occurs Due to Transitive Dependencies in Auth0 Actions
Last Updated:
Overview
An Auth0 Action using a specific library functions correctly in one trigger but displays a missing module warning in the Auth0 Action editor when the dependencies list lacks the library. The Auth0 Action editor displays a red underline beneath the affected code line. Hovering over the line displays the following message:
Add the npm package uuid to the list of dependencies of your Action
This occurs because another package loads the library as a transitive dependency. Resolve this issue by explicitly adding the required library as a direct dependency in the Action.
Applies To
- Auth0
- Actions
Cause
The library functions without an explicit listing because it acts as a transitive dependency. For example, the auth0@5.11.0 package contains uuid. When an Action includes the auth0 package, Auth0 automatically installs uuid to satisfy that requirement. However, relying on transitive dependencies causes missing module errors in other triggers or when the parent package updates and removes the indirect dependency.
Solution
How is the missing module error resolved?
Adding the required library as a direct dependency ensures the Action remains robust and prevents unexpected failures resulting from updates to other packages.
Navigate to the Auth0 Action editor, locate the dependencies section, add the required library as a direct dependency, and deploy the changes.
- Open the Auth0 Action.
- Locate the dependencies section.
- Add the required library (for example, uuid) as a direct dependency.
- Save and deploy the Action.