Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Cannot read property 'generateExportInfo' of undefined #5

Closed
LeoEatle opened this issue Aug 27, 2018 · 6 comments
Closed

Cannot read property 'generateExportInfo' of undefined #5

LeoEatle opened this issue Aug 27, 2018 · 6 comments
Labels
bug Something isn't working

Comments

@LeoEatle
Copy link

LeoEatle commented Aug 27, 2018

Hey, I tried your plugin in a simple demo and it works well. Now I want to apply it to my team project which is much bigger. Then it failed and throw this error.

image

Here is the environment:
Node v8.11.3
webpack v4.17.1

Here are part of used plugins:

new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.HashedModuleIdsPlugin(),
new WebpackDeepScopeAnalysisPlugin()

I can't figure out if it is my mistake or a bug of this plugin.

@vincentdchan
Copy link
Owner

It seems that other plugin change the module that my plugin can not find some of them. I am going to debug with ModuleConcatenationPlugin.

@vincentdchan vincentdchan added the bug Something isn't working label Aug 28, 2018
@LeoEatle
Copy link
Author

LeoEatle commented Aug 28, 2018

Yes. If I remove webpack.optimize.ModuleConcatenationPlugin, it works well.
My project is a multi-entry project. So I don't think ModuleConcatenationPlugin is helpful here.
Is multiple entry the reason why it failed?

@vincentdchan
Copy link
Owner

Hi, @LeoEatle . I have published a pre-release version for this case. I want you to try it and I suppose it doesn't crash now.

Please upgrade to [email protected].

@vincentdchan
Copy link
Owner

@LeoEatle Multi-entry can't make it crash. It crashed because ModuleConcatenationPlugin concats modules and my plugin can't find the analysis result of concatenation modules.

@LeoEatle
Copy link
Author

OK, I tried [email protected] and there's no error anymore. I think I can close this issue now.
Though, I don't find out any difference in size of the final bundle js files. I need to find out whether my code are free of these scope issues or the plugin is not working.

@vincentdchan
Copy link
Owner

@LeoEatle Check if your babel/ts transpiled your code into UMD/CommonJS(ES6 module is required for optimization). And please use library that uses ES6 module(lodash-es instead of lodash)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants