nango-esm-migration

Fix CJS to ESM migration issues in Nango integrations.

1|1|Updated Oct 30, 2025
One-click install
npx skills add https://github.com/NangoHQ/ai-ide-prompts --skill nango-esm-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nango-esm-migration
Source: https://github.com/NangoHQ/ai-ide-prompts/tree/main/.claude/skills/nango-esm-zero-yaml-migration
Command: npx skills add https://github.com/NangoHQ/ai-ide-prompts --skill nango-esm-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill documents common issues and fixes when migrating Nango integrations to ESM (zero-yaml migration) — covering import path fixes, creating ESM wrappers for CJS vendor modules, and restoring commented-out code to ensure reliable builds.

Core Features & Use Cases

  • Migration diagnosis: Identify CJS/ESM compatibility issues encountered during zero-yaml migration.
  • ESM wrappers: Create wrappers under vendor modules to expose proper ESM exports.
  • Import path corrections: Fix incorrect or missing file extensions and path references.
  • Use Case: When a Nango integration breaks due to missing ESM exports or wrong import paths, use this Skill to stabilize the codebase.

Quick Start

When migrating a Nango integration to ESM, use this Skill to correct broken imports and add an ESM wrapper for vendor modules. Example: fix the import path for dinero.js and create an ESM wrapper at vendor/dinero.js/index.js.

Frequently Asked Questions about nango-esm-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix import path errors when migrating Nango integrations to ESM?

ESM import paths require explicit file extensions. Add .js extensions to all relative imports (e.g., `./mapper.js` instead of `./mapper`) and correct absolute paths to vendor modules. TypeScript will validate the corrected paths during compilation.

What's the best way to create ESM wrappers for CommonJS vendor modules in Nango?

Create an ESM wrapper file at `vendor/[module-name]/index.js` that re-exports the CJS module using `export * from`. This enables ESM integrations to consume CJS dependencies like dinero.js without breaking the build.

Why does my Nango integration fail after zero-yaml migration to ESM?

Common causes include incorrect import paths missing .js extensions, CJS vendor modules without ESM wrappers, and commented-out or placeholder code. This Skill diagnoses and fixes all three issues to stabilize the build and pass TypeScript checks.

Do I need to restore commented-out code when migrating to ESM?

Yes. During migration, placeholder or commented code must be restored to proper implementations in mappers and actions. Incomplete code prevents the Nango compile workflow from succeeding and causes runtime failures.

Can I use third-party libraries like dinero.js directly in ESM Nango integrations?

Direct CJS imports fail in ESM. You must create an ESM wrapper for dinero.js or similar vendor modules, then import from the wrapper instead of the original package to maintain compatibility.