October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

TypeError: __exportAll is not a function: Why a Deploy Breaks Only After You Merge

The error only says the called value isn't a function. Here is how to compare the good and bad builds, and test module format, export shape, externals and runtime differences.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

TypeError: __exportAll is not a function means one thing at runtime: at the line that failed, the value bound to the name __exportAll was not callable. The message doesn’t name a package, a bundler or a root cause. No official documentation we reviewed defines __exportAll as a standard JavaScript or Node.js API. The leading underscores suggest a helper that a build tool generated, but that is only a hint. Confirm it in your own output before you act on it.

The fix is to stop reading the source and read the artifact that actually ran in production. Compare it with the last build that worked.

Start with the artifact, not the source

A deploy that works on a branch and fails after merge usually means the merged build differs from what you tested. Possible differences include dependency resolution, build configuration, the environment the build ran in, and the runtime that loads the result. Work through these steps in order.

  1. Get the full stack trace from production logs or the browser console, ideally with source maps. Note the file, line and column of the failing call.
  2. Open the emitted file that the trace points to, not your source. Search it for __exportAll to see whether it is defined, where it is defined, and what it is assigned.
  3. Rebuild the last known-good commit and the merged commit with the same command. Diff the output files, not just the source.
  4. Diff the inputs: the lockfile, package.json (including type and exports of any changed dependency), bundler config, and the deployment manifest.
  5. Check where the build runs. If CI builds from a clean install and your machine reuses an old node_modules, the two builds may resolve different dependency versions.

These steps are an investigation, not a claim that a merge necessarily changed any of these things. They narrow the search until one of the branches below fits.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Cause branches to test

Each branch asks a different question. Together they cover most “function is not a function after deploy” failures.

1. Is the expected symbol present in the deployed artifact?

If __exportAll is called but never defined in the file that runs, the chunk that should provide it was not shipped, was split differently, or was loaded in the wrong order. If it is defined but holds an object or undefined, move to the export-shape branch. Platforms often let you inspect the upload before it goes out. Cloudflare Workers, for example, documents wrangler deploy --dry-run --outdir dist to write out the bundled code Wrangler would upload (Cloudflare Workers bundling). That command is specific to that platform. Other hosts have their own way to download or preview the deployed bundle.

2. Did the runtime pick a different entry point or module format?

Node.js uses a package’s type field to decide how .js files are interpreted. A package’s exports map defines its public entry points and can point import and require at different files (Node.js: Packages). So a dependency can behave differently depending on whether it was loaded as ESM or CommonJS. A dependency update that adds or changes exports or type can change which file loads in production without changing a line of your code. Check which condition (import, require, default, or a custom one) your runtime or bundler selected.

3. Does the import match the export’s shape?

Confirm at the import and call site that the thing you request exists and is the type you call. Typical mismatches are a default import where the module only has named exports, a named import from a CommonJS module that exports a single function, and a namespace object called as if it were a function. Rollup lists a missing corresponding export as an error and identifies CommonJS conversion as a frequent source of export problems (Rollup troubleshooting). Log the imported value with typeof and Object.keys in a scratch build. That shows quickly whether you got a function, an object with a default property, or nothing.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Was something bundled locally but external in production, or the reverse?

If a dependency is marked external, the bundle does not contain it. The production environment must supply it in the format the bundle expects, such as a CommonJS module or a global, at the location the bundle looks for. Webpack documents that the externals configuration decides how a dependency is made available under different module systems (webpack externals). If a merge changed which packages are external, or changed the install step (for example, dev dependencies pruned in the production image), the runtime may resolve a different module than your local build did.

5. Does the production runtime differ from local?

Code that relies on a browser global such as window can fail when it runs in Node.js, as MDN notes in its modules guide (MDN: JavaScript modules). The same applies to server, edge and worker runtimes, which each expose different globals and built-ins. Check that the runtime and version in production match what you build and test against.

6. Module Federation only: remote containers and build names

This applies only if you use webpack Module Federation. Nothing in the error message suggests you do. Webpack lists a missing remote container and duplicate build names as runtime failure scenarios. Its guidance for the first case is: “You are likely missing the remote container, make sure it’s added.” Confirm the remote’s entry script actually loads in production, and that each build sets a unique output.uniqueName (webpack Module Federation). That advice is for federated setups, not a general diagnosis for every function TypeError.

7. Framework deployment bundles

Some frameworks produce a separate deployment bundle with its own package metadata, runtime assets and externals. Egg.js’s bundle deployment documentation, for example, describes a CommonJS bundle and warns that external packages must be available where Node can resolve them (Egg.js bundle deployment). Treat it as an example of the pattern: if your framework emits a bundle, inspect that output directory as a deployable unit, and check what the deploy actually copies or installs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Quick decision guide

What you see in the deployed file Likely branch Next check
__exportAll is never defined Missing or reordered chunk, or a wrong file shipped Compare file lists between good and bad builds; check the deploy manifest
Defined, but the value is an object or undefined Export shape or CommonJS/ESM interop Log typeof at the import site; inspect the dependency’s exports and type
Works on the merged branch locally, fails in CI or production Different dependency resolution, externals or runtime Clean install from the lockfile; compare Node version and the production install step
Only fails in a federated host or remote Missing remote container or duplicate build name Check remote entry loading and output.uniqueName
Fails only where a browser global is used Runtime mismatch Guard or move the browser-only code; check where it executes

Pinning down the merge

Once you can reproduce the failure from a clean build, bisect. Use git bisect between the last good commit and the merged one, and run the build plus a smoke test of the failing path at each step. Two practical rules help. Always install from the lockfile (npm ci, pnpm install --frozen-lockfile, or your manager’s equivalent), so a floating version range does not hide the real change. Always diff the lockfile in the merge, because a merge that resolves lockfile conflicts by regenerating it can move many transitive dependencies at once.

When you find the culprit, fix it at the source: pin or update the dependency, correct the import to match the real export, adjust the externals list, or make the production install match the build assumptions. Add a post-build smoke test that loads the built output in the same runtime as production, so this class of failure surfaces before deploy rather than after merge.

What is and isn’t established

The sources above support these as separate diagnostic branches: whether the symbol exists in the artifact, which export shape and module format the runtime selected, and whether externals or remote containers are present in production. None of them identifies a single universal cause of this exact message, and no published figure on how often it occurs or which fix works most often turned up. If a specific tool’s changelog or issue tracker names __exportAll, treat that as the authority for your stack and use these checks to confirm it against your own output.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.