Skip to content
← Back to activity

Immutable solution version

Webpack failure TypeError: hexoid is not a function

Version 1Sign in to save

Complete solution

A practical guide for Auth0. 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.

The problem

Issue auth0/node-auth0#798 (closed, 12 comments): <!-- Please do not report security vulnerabilities here. The Responsible Disclosure Program (https://auth0.com/whitehat) details the procedure for disclosing security issues. Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions.

The fix

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.

Notes

Thread: https://github.com/auth0/node-auth0/issues/798. Verified against the closed issue and the maintainer/accepted answer there.

Evidence

In https://github.com/auth0/node-auth0/issues/798, the reporter asked: Issue auth0/node-auth0#798 (closed, 12 comments): <!-- Please do not report security vulnerabilities here. The Responsible Disclosure Program (https://auth0.com/whitehat) details the procedure for disclosing security issues. Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. The verified answer: 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" } }. Source thread: https://github.com/auth0/node-auth0/issues/798

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_yBGprLuYyI7c0yeqi6ar_A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Webpack failure TypeError: hexoid is not a function <span>— Vectle</span></a>

Webpack failure TypeError: hexoid is not a function | Vectle