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

webpack require undefined when used alongside NamedModulesPlugin #29

Closed
Connorelsea opened this issue Aug 24, 2017 · 9 comments · Fixed by #30
Closed

webpack require undefined when used alongside NamedModulesPlugin #29

Connorelsea opened this issue Aug 24, 2017 · 9 comments · Fixed by #30
Labels

Comments

@Connorelsea
Copy link

I am getting this error when attempting to integrate this into my webpack config. I am using this webpack config: https://github.com/Connorelsea/react-typescript-starter/blob/master/webpack.prod.js

image

@mastilver
Copy link
Owner

mastilver commented Aug 24, 2017

Yep managed to reproduced it, I will try to find what's the issue here

In the meantime, let me know if you find where it's coming from!

@mastilver
Copy link
Owner

Looks like it's caused by NamedModulesPlugin, which is weird because I'm using it as well on my project without any issue :/

@Connorelsea
Copy link
Author

What version of NamedModulesPlugin/webpack are you using and what order should it be included in?

@mastilver
Copy link
Owner

I'm using webpack@2 and it doesn't have to do with the order

I've got a failing test, I'm now trying to find where it's coming from :)

@mastilver mastilver changed the title Bug on first use webpack require undefined when used alongside NamedModulesPlugin Aug 24, 2017
@mastilver mastilver added the bug label Aug 24, 2017
@mastilver
Copy link
Owner

So yeah, this issue is only happening on webpack@3

@mastilver
Copy link
Owner

Released in 3.4.0

@Connorelsea
Copy link
Author

This fixed it for me. Thanks a ton! @mastilver

@Connorelsea
Copy link
Author

Getting a 98 in performance on light house using this in my build

image

@mastilver
Copy link
Owner

@Connorelsea Which is better or worst?

Depends on the context but the majority of the time, the first visit is slower than not using this plugin
But on the long term, it becomes handy as your dependencies don't update as much as your code, so your users won't need to re-download your dependencies again and again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants