Merged
Conversation
These packages are now ESM-only, which is incompatible with @vercel/ncc's CJS bundling. Switch the bundler from ncc to esbuild, set package type to "module", update tsconfig to use node16 module resolution, and rename jest.config.js to jest.config.cjs for CJS compatibility. https://claude.ai/code/session_01QwnXfWH2ELHXvNgijYTeM1
The "type": "module" in package.json caused the CJS esbuild bundle to be parsed as ESM at runtime, breaking require() calls for Node.js built-ins. Instead, use moduleResolution: "bundler" in tsconfig which resolves ESM exports fields correctly while keeping the project as CJS. Revert jest.config.cjs back to jest.config.js. https://claude.ai/code/session_01QwnXfWH2ELHXvNgijYTeM1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates the project from CommonJS to ES modules (ESM), modernizing the module system and aligning with current JavaScript standards.
Key Changes
"type": "module"topackage.jsonto enable ESM supporttsconfig.jsonto compile TypeScript to ES modules instead of CommonJSjest.config.jstojest.config.cjsto maintain CommonJS for Jest configuration (which requires CommonJS)dist/index.js) to reflect the new module formatImplementation Details
https://claude.ai/code/session_01QwnXfWH2ELHXvNgijYTeM1