Strange clash between Auth0 and NextApiRequest types

Please include the following information in your post:

  • Which SDK this is regarding:
  • SDK Version:
  • Platform Version:
    Code 12.22
  • Code Snippets/Error Messages/Supporting Details/Screenshots:

Example sandbox: objective-turing-zo9bl - CodeSandbox

I have an odd issue where simply installing Auth0 causes my NextApiRequest types to error in the IDE and when running tsc:

If I uninstall Auth0, everything works fine. I’m not sure why this is occuring or how to resolve it.

The example sandbox includes a contrived route and a test for that route which demonstrates the issue. Remove auth0 from the dependencies to see everything works fine.