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

Webpack2: undefined meta in HarmonyImportDependency and HarmonyImportSpecifierDependency #1833

Closed
RickWong opened this issue Jan 3, 2016 · 1 comment
Labels

Comments

@RickWong
Copy link

RickWong commented Jan 3, 2016

I'm using webpack 2.0.2-beta. In short, webpack2 attempts to access dep.module.meta.harmonyModule and dep.importDependency.module.meta.harmonyModule which causes an error reading from undefined, which points to the .meta part. Here's the full build output of one of the source files, the other is mostly similar:

ERROR in chunk main [entry]
server.js
Cannot read property 'harmonyModule' of undefined
TypeError: Cannot read property 'harmonyModule' of undefined
    at Function.HarmonyImportDependency.makeStatement (/Users/rick/Sites/react-isomorphic-starterkit/node_modules/webpack/lib/dependencies/HarmonyImportDependency.js:35:22)
    at HarmonyImportDependencyTemplate.HarmonyImportDependency.Template.apply (/Users/rick/Sites/react-isomorphic-starterkit/node_modules/webpack/lib/dependencies/HarmonyImportDependency.js:48:40)

I stumbled on this error while using this config: https://github.com/RickWong/react-isomorphic-starterkit/blob/534c2542701c4db966ef0679bd8de0236fcadd65/configs/webpack.server.js Note that this config marks all node_modules as externals because its result should run in a node server.

By checking the .metas in both files first, I'm able to complete the build successfully. It would be nice if 2.0.3-beta would include this fix.

Should I make a Pull Request?

@RickWong
Copy link
Author

RickWong commented Jan 6, 2016

Thanks!

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

No branches or pull requests

2 participants