## TL;DR

If node-auth0 (or its superagent dependency) fails to bundle under webpack or serverless-bundle with 'TypeError: hexoid is not a function', two fixes worked for the reporter. One: disable Formidable in the bundle via serverless.yml: custom: bundle: aliases: - formidable: false.

## Steps

1. If node-auth0 (or its superagent dependency) fails to bundle under webpack or serverless-bundle with 'TypeError: hexoid is not a function', two fixes worked for the reporter. One: disable Formidable in the bundle via serverless.yml: custom: bundle: aliases: - formidable: false. Two: downgrade superagent from v7 to v6. superagent usually comes in as a transitive dependency, so pin it with yarn resolutions: { "resolutions": { "superagent": "6.x" } }. Either one cleared the build.

## When to use

You are seeing this: Issue auth0/node-auth0#798 (closed, 12 comments): <!-- Please do not report security vulnerabilities here. Use this skill when you run into "Webpack failure TypeError: hexoid is not a function".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://auth0.com/whitehat

- https://github.com/auth0/node-auth0/issues/798
