-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Element type invalid when importing module via commonjs' require #136
Comments
I think upgrading to Babel 6 caused this breaking change in the past. (So I think there's a breaking change between 1.2.0 and 1.3.1 somewhere. According to this SO question, this plugin will bring back the old behavior that exports things at the top-level and as (I was trying to upgrade form 1.2.0 to 1.3.1 and couldn't because of this. In different places in my codebase I have |
Using |
FYI this should have been solved in v2. |
@LeoAref reported in this message that requiring the component via commonjs would throw an invariant violation:
console output:
A temporary workaround is to use the exported
default
object:The way of exporting in the main script doesn't indeed consider this case, so instead of writing
I'd put
...considering we must support webpack, commonjs, babel 5 and babel 6 😅
I tag this as breaking change since users may already require using the above workaround.
The text was updated successfully, but these errors were encountered: