Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(esm): Use explicit .mjs extension for ESM #7244

Merged
merged 1 commit into from
Dec 8, 2021

Conversation

evocateur
Copy link
Contributor

This ensures that Node always treats the ESM output as ESM, despite the package.json (implicit) type of commonjs. Bundlers that expect ESM, such as Next v12, no longer explode when encountering this module.

Refs #7095
Refs #7088
Refs react-hook-form/resolvers#271
Refs vercel/next.js#30750

This ensures that Node always treats the ESM output as ESM, despite the package.json (implicit) type of commonjs. Bundlers that expect ESM, such as Next v12, no longer explode when encountering this module.

Refs react-hook-form#7095
Refs react-hook-form#7088
Refs react-hook-form/resolvers#271
Refs vercel/next.js#30750
@bluebill1049
Copy link
Member

thank you very much @evocateur 🥳

@bluebill1049 bluebill1049 merged commit 995c7c8 into react-hook-form:master Dec 8, 2021
@evocateur
Copy link
Contributor Author

@bluebill1049 Glad I could help!

@evocateur evocateur deleted the fix-esm-export branch December 8, 2021 22:35
@bluebill1049
Copy link
Member

Hi @evocateur sorry, I have to revert this PR to fix this issue for now: #7251 let me know if you have any clue for the fix.

bluebill1049 added a commit that referenced this pull request Dec 10, 2021
@evocateur
Copy link
Contributor Author

@bluebill1049 No worries, I understand. ESM is a giant pain. There's always patch-package, I guess.

(lolsob corporate security policies that require a separate GitHub account for work)

evocateur added a commit to evocateur/react-hook-form that referenced this pull request Dec 10, 2021
This ensures that Node always treats the ESM output as ESM, despite the package.json (implicit) type of commonjs. Bundlers that expect ESM, such as Next v12, no longer explode when encountering this module.

Refs react-hook-form#7244
Refs react-hook-form#7095
Refs react-hook-form#7088
Refs react-hook-form/resolvers#271
Refs vercel/next.js#30750
@bluebill1049
Copy link
Member

thanks for the help and contribution @evocateur 🙏

bluebill1049 pushed a commit that referenced this pull request Dec 11, 2021
)

* build(esm): Use explicit .mjs extension for ESM

This ensures that Node always treats the ESM output as ESM, despite the package.json (implicit) type of commonjs. Bundlers that expect ESM, such as Next v12, no longer explode when encountering this module.

Refs #7244
Refs #7095
Refs #7088
Refs react-hook-form/resolvers#271
Refs vercel/next.js#30750

* fix(esm-interop): Import non-ESM React as default
bluebill1049 added a commit that referenced this pull request Dec 13, 2021
… (#7262)

* build(esm): Use explicit .mjs extension for ESM, with CJS interop (#7261)

* build(esm): Use explicit .mjs extension for ESM

This ensures that Node always treats the ESM output as ESM, despite the package.json (implicit) type of commonjs. Bundlers that expect ESM, such as Next v12, no longer explode when encountering this module.

Refs #7244
Refs #7095
Refs #7088
Refs react-hook-form/resolvers#271
Refs vercel/next.js#30750

* fix(esm-interop): Import non-ESM React as default

* 7.21.3-beta.0

* update with v2 compress

* fix lint error and update packages

Co-authored-by: Daniel Stockman <5605+evocateur@users.noreply.github.com>
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.

None yet

2 participants