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

esm support to fix bundler incompatibility #95

Merged
merged 2 commits into from Dec 29, 2020

Conversation

benallfree
Copy link
Contributor

@benallfree benallfree commented Dec 29, 2020

This package dist is currently not compatible with bundlers.

tsc outputs a commonjs format, but that is for node environments, not browser. It causes Object.defineProperty(exports, "__esModule", { value: true }); to be emitted, which causes an error in a browser.

I updated tsconfig.json to output esnext instead, and that fixes the problem.

See for more info: https://blog.rendall.dev/posts/2019/1/14/problem-typescript-adds-objectdefinepropertyexports-esmodule-value-true/

@benallfree benallfree marked this pull request as ready for review December 29, 2020 20:55
@jorisre
Copy link
Member

jorisre commented Dec 29, 2020

👋🏻 @benallfree
Thank you for your work!
Do you also have this problem ?

@benallfree
Copy link
Contributor Author

@jorisre Yes, this fixes #71. Thanks for catching that!

Copy link
Member

@jorisre jorisre left a comment

Choose a reason for hiding this comment

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

LGTM Thanks @benallfree !

@bluebill1049 bluebill1049 merged commit 75b8d16 into react-hook-form:master Dec 29, 2020
@bluebill1049
Copy link
Member

Thanks @jorisre shall we do a release with it today?

@jorisre
Copy link
Member

jorisre commented Dec 29, 2020

Thanks @jorisre shall we do a release with it today?

Yes you can :)

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

3 participants