remotion-dev/remotion · error · Error

Failed to patch ESLint because the calling module was not re

Error message

Failed to patch ESLint because the calling module was not recognized.
If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:
https://github.com/remotion-dev/remotion/issues

What it means

The `@remotion/eslint-config` package patches ESLint's internal module resolution to fix plugin lookup (a workaround for eslint/eslint#3458). The patcher walks up the Node.js `require` stack to locate the calling ESLint module. If it reaches the top of the module tree without recognizing any module as belonging to ESLint, it throws this error. This means the installed ESLint version has an internal layout the patcher does not recognize.

Source

Thrown at packages/eslint-config/src/patch-eslint.ts:237

				/[\\/]eslint[\\/]lib[\\/]cli-engine[\\/]config-array-factory\.js$/i.test(
					currentModule.filename,
				)
			) {
				eslintFolder = path.join(path.dirname(currentModule.filename), '../..');
				configArrayFactoryPath = path.join(
					eslintFolder,
					'lib/cli-engine/config-array-factory',
				);
				moduleResolverPath = path.join(
					eslintFolder,
					'lib/shared/relative-module-resolver',
				);
				break;
			}

			if (!currentModule.parent) {
				// This was tested with ESLint 6.1.0 .. 7.12.1.
				throw new Error(
					'Failed to patch ESLint because the calling module was not recognized.\n' +
						'If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:\n' +
						'https://github.com/remotion-dev/remotion/issues',
				);
			}

			currentModule = currentModule.parent;
		}
	}

	// Detect the ESLint package version
	const eslintPackageJson = fs
		.readFileSync(path.join(eslintFolder, 'package.json'))
		.toString();
	const eslintPackageObject = JSON.parse(eslintPackageJson);
	const eslintPackageVersion = eslintPackageObject.version;
	const versionMatch = /^([0-9]+)\.([0-9]+)\./.exec(eslintPackageVersion);
	if (!versionMatch) {

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Pin ESLint to a version in the 6.x–9.x range that Remotion supports.
  2. Upgrade `@remotion/eslint-config` to the latest version which may support newer ESLint.
  3. If on a supported version, report the issue to Remotion with the ESLint version and call stack.

Example fix

// before
"devDependencies": { "eslint": "^10.0.0" } // unsupported

// after
"devDependencies": { "eslint": "^9.0.0" } // supported
Defensive patterns

Strategy: validation

Validate before calling

// Verify ESLint version before the patch runs
const eslintVersion = require('eslint/package.json').version;
const major = Number(eslintVersion.split('.')[0]);
if (major < 6 || major > 9) {
  throw new Error(`Unsupported ESLint version ${eslintVersion}. Use 6.x–9.x.`);
}

Try / catch

try {
  require('@remotion/eslint-config/patch-eslint');
} catch (err) {
  if (err instanceof Error && err.message.includes('calling module was not recognized')) {
    // pin ESLint to a supported version
    console.error('ESLint version not recognized. Pin to 6.x–9.x.');
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: Installing an ESLint version newer than what the patcher supports (currently tested for 6.x–9.x), using a bundled/packaged ESLint whose internal file paths differ, or loading ESLint from a non-standard location (e.g., webpack-bundled).

Common situations: Upgrading ESLint to a new major version before Remotion adds support, using a monorepo with an unusual ESLint hoisting setup, or running ESLint through a custom runner that obscures the module stack.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/e779a208f74825d5. Report an issue: GitHub.