Skip to content

Commit 36260dc

Browse files
committed
fix: resolve ES module compatibility issues with dual-module setup
🔧 Module System Fixes: - Update build process to output .cjs files for CommonJS compatibility - Add build:rename script to convert .js to .cjs extensions - Update package.json main entry to point to build/server.cjs - Update bin entry to use build/server.cjs - Restore 'type': 'module' for Smithery.ai compatibility 📦 Dual Module Support: - CommonJS: build/server.cjs (for npm/CLI usage) - ES Modules: src/index.ts (for Smithery.ai deployment) - Jest configs: .cjs extensions (for test compatibility) ✅ Verification Results: - npm run test:ci: ✅ 31 tests pass - npm run build: ✅ Creates .cjs files correctly - npm run build:smithery: ✅ ES modules for Smithery - require('./build/server.cjs'): ✅ CommonJS import works - Server startup: ✅ CLI functionality preserved This resolves the 'require() of ES Module not supported' error while maintaining compatibility with both traditional npm usage and modern Smithery.ai deployment requirements.
1 parent 62e80a0 commit 36260dc

File tree

13 files changed

+37
-396
lines changed

13 files changed

+37
-396
lines changed

build/config/constants.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

build/index.js

Lines changed: 0 additions & 220 deletions
This file was deleted.

build/sdk-schemas.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

build/services/n8nApi.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

build/services/workflowBuilder.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

build/types/api.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

build/types/node.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

build/types/workflow.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

build/utils/positioning.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

build/utils/validation.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)