Skip to content

fix(dingtalk): add ESM package.json to resolve runner.ts top-level aw…#122

Merged
xiami762 merged 1 commit intomainfrom
fix/dingtalk-runner-esm-module-type
Apr 14, 2026
Merged

fix(dingtalk): add ESM package.json to resolve runner.ts top-level aw…#122
xiami762 merged 1 commit intomainfrom
fix/dingtalk-runner-esm-module-type

Conversation

@duguwanglong
Copy link
Copy Markdown
Contributor

runner.ts uses top-level await but tsx defaults to CJS output format when no package.json with "type": "module" exists in the file's parent directory. The connector's own package.json already declares ESM but it lives in a child directory and does not cover runner.ts.

Adding a minimal package.json next to runner.ts tells Node.js/tsx to treat it as an ES module, allowing esbuild to use the ESM output format which supports top-level await.

…ait error

runner.ts uses top-level await but tsx defaults to CJS output format
when no package.json with "type": "module" exists in the file's parent
directory. The connector's own package.json already declares ESM but
it lives in a child directory and does not cover runner.ts.

Adding a minimal package.json next to runner.ts tells Node.js/tsx to
treat it as an ES module, allowing esbuild to use the ESM output
format which supports top-level await.

Made-with: Cursor
@duguwanglong duguwanglong requested a review from xiami762 April 14, 2026 09:15
@xiami762 xiami762 merged commit 98777ca into main Apr 14, 2026
2 checks passed
@xiami762 xiami762 deleted the fix/dingtalk-runner-esm-module-type branch April 14, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants