Skip to content

Conversation

dgreif
Copy link
Contributor

@dgreif dgreif commented May 3, 2022

After #9, we have both commonJS and esm. When imported from commonjs, it will resolve the cjs files, but it iterprets them as esm because the nearest package.json is type: module

To fix this, we can add a new package.json in dist/cjs with { "type": "commonjs" } to hint to node that the code is indeed cjs

Big thanks to @calebboyd for pointing this out!

@dgreif dgreif requested a review from a team as a code owner May 3, 2022 02:47
@dgreif dgreif requested a review from srt32 May 3, 2022 02:47
Copy link

@jfuchs jfuchs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅 good catch

@dgreif dgreif merged commit 9005798 into main May 3, 2022
@dgreif dgreif deleted the default-type-cjs branch May 4, 2022 03:12
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