-
Notifications
You must be signed in to change notification settings - Fork 417
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
Some modules are missing when using webpack 2 #116
Comments
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. |
Reopened the issue after deeper investigation. Changed the description and subject to match my findings and the problem. |
Further analysis: 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. |
Fixing #71 would also fix this it seems. |
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 |
any updates on this? |
@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 |
Problem
We tried to use Webpack 2 and the current master branch of the webpack plugin.
The bundle generation is creating a correct bundle, but the packaged node modules,
that are installed as sibling to the bundle by the plugin are missing some external modules.
I.e. although they are present in the local services' package.json, they do not appear in
the package.json that is temporarily created by the webpack plugin to install the needed
external modules.
This leads to "required module not found" errors, when executing the compiled code on AWS
after Serverless deployed it.
Root cause
The plugin parses the webpack stats to find external modules by matching the returned stats
with "external ".
See comment below: Webpack 2's dependency optimization sometimes removes first level dependencies but keeps the removed dep's second level dependencies.
The text was updated successfully, but these errors were encountered: