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

[2.0-beta.17] HMR bundle has errors: exports is not allowed in EcmaScript module #766

Closed
Zaiban opened this issue Jan 14, 2017 · 11 comments
Closed
Labels
Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).

Comments

@Zaiban
Copy link

Zaiban commented Jan 14, 2017

Got the following error after updating to beta 17:

sieppaa

Any clue to what might cause this?

@nkzawa
Copy link
Contributor

nkzawa commented Jan 14, 2017

It looks this warning was added on [email protected] which we introduced on beta 17.

Actually, it seems this is a bug of webpack since these modules (lodash-es/_cloneBuffer etc) don't use exports, but just check existence of it like typeof exports == 'object' && exports.

@nkzawa nkzawa added Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.). Type: Bug labels Jan 14, 2017
@nkzawa
Copy link
Contributor

nkzawa commented Jan 14, 2017

This is it. webpack/webpack#3917

@nkzawa
Copy link
Contributor

nkzawa commented Jan 14, 2017

Anyway, I don't think lodash-es properly works since you can't use it on Server Side (no webpack compilation) for now.

@arunoda
Copy link
Contributor

arunoda commented Jan 14, 2017

@nkzawa what's our plan for this?
If they didn't fix this sooner, are we going to revert back to the previous version? (Bring back our dynamic entry plugin stuff?)

@nkzawa
Copy link
Contributor

nkzawa commented Jan 15, 2017

I think we don't have to revert since import/export statements don't work on server anyway.

@arunoda
Copy link
Contributor

arunoda commented Jan 15, 2017

@Zaiban FYI: You need to the normal version lodash instead of lodash-es

@Zaiban
Copy link
Author

Zaiban commented Jan 15, 2017

Actually I'm already using the normal lodash. Maybe this comes from a dependency? Need to do some digging.

@Zaiban
Copy link
Author

Zaiban commented Jan 15, 2017

Well grepping for lodash-es reveals that redux-form, react-redux and babel-plugin-lodash all have lodash-es as a dependency. Tried to disable the babel plugin already but no effect. And getting rid of redux-form and react-redux is not really a valid option at this point :/

@arunoda
Copy link
Contributor

arunoda commented Jan 15, 2017

@Zaiban That's a valid question.
I think we need to make issues for different upstream libraries for this.

EDIT: Anyway, I assume webpack will actually fix this issue.

@arunoda
Copy link
Contributor

arunoda commented Jan 15, 2017

@nkzawa about the lodash-es.
I think it works fine for us.
This is how people use it.

They use it with the module target in package.json.
See how react-redux does it.

So, it only picks by webpack. For node, it still uses the main target and it works fine.
I didn't test this, but it should work fine.

@nkzawa
Copy link
Contributor

nkzawa commented Jan 16, 2017

Updated webpack da83958

@nkzawa nkzawa closed this as completed Jan 16, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).
Projects
None yet
Development

No branches or pull requests

3 participants