-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
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
thank you very much @evocateur 🥳 |
@bluebill1049 Glad I could help! |
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. |
This reverts commit 995c7c8.
@bluebill1049 No worries, I understand. ESM is a giant pain. There's always (lolsob corporate security policies that require a separate GitHub account for work) |
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
thanks for the help and contribution @evocateur 🙏 |
) * 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
… (#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>
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