Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Some modules are missing when using webpack 2 #116
We tried to use Webpack 2 and the current master branch of the webpack plugin.
I.e. although they are present in the local services' package.json, they do not appear in
This leads to "required module not found" errors, when executing the compiled code on AWS
The plugin parses the webpack stats to find external modules by matching the returned stats
See comment below: Webpack 2's dependency optimization sometimes removes first level dependencies but keeps the removed dep's second level dependencies.
I'll have to investigate this further. The package.json created by the plugin in .webpack is different regarding the dependencies than the original package.json. I'll reopen this as soon as I have more qualified information at hand.
The stats object returned by webpack 2 contains all external references marked with "external ", including the second level dependencies.
This happened for us with
The plugin grabs all exported dependencies but cannot npm install the
A solution would be, that the module lookup is improved, so that each dependency reported by webpack 2 will be looked up with a deep search, beginning from the main service package.json throughout all of the (production) dependencies' dependencies. This would make sure that webpack 2's optimization will work with the plugin.
It is even more complex. The new webpack 2 optimizer now emits partial modules as external references:
This means that the npm install approach will not work anymore, because the referenced externals might be only submodules or files out of an installed module.
I am also experiencing a similar issue where I use yarn to install a local npm module (a library I have created) and webpack reports a "Webpack Missing Module 'Module Not Found'". Not sure if this is an error with webpack or this plugin as I didn't have time to dig too deeply
referenced this issue
Jul 30, 2017
@daviskoh I stabilized the packaging in V3 and we run that already in our production environment. You can try it by using version
However, the key to make it work well, is to use the new