Closed jkrems closed 6 years ago
Looks like this behavior is triggered by a fun back and forth between imports, combined with "sideEffects": false
in a package.json
. The pure-pkg
directory is a simplified version of apollo-utilities
.
Tested against an internal app. Assets are now building and the test suite passes.
The webpack 4 release of the plugin didn't properly handle some advanced cases (and who knows, maybe also some simpler ones I just haven't found yet). Specifically it broke when it encountered side-effect free ES6 modules that could be removed from the module graph entirely.
fixtures/complex
).mapModule
.analyzer.resolve
.Original Description
This is more a bug report than a solution. For some reason in some situations (observed in a bigger app using.forEach isn't a function" when it hits
apollo-client
),module.mergeFrom
is called for unresolved modules that have already been cleared. This triggers the unhelpful error "unresolved.uses.forEach
.So far I have no real reproduction and I'm not sure yet what could trigger this scenario.