Can’t import a chunk from dll

Do you want to request a feature or report a bug?

What is the current behavior?
I get an error “Module not found: Error: Can’t resolve…” while trying to build my code.

If the current behavior is a bug, please provide the steps to reproduce.

Here is a test repo

  1. npm run build:dll
  2. npm run build:app

I have a simple dll a, importing 2 modules – b, and c. Module b is imported directly, while module c is chunked out. All of these gets build into a dll, using webpack.DllPlugin.

Next, I have a simple app, consuming this dll we built before, scoped under the LIB namespace. Importing module b from the dll works fine, but trying to import module c ends up with error:

Module not found: Error: Can't resolve 'LIB/c' in 'E:\Dev\dll-broken'

What is the expected behavior?
I’d expect all of dll modules to be consumable by my app.

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
Node 7.8.0
Webpack 2.3.3
Windows 10

P.S. Analyzing manifest.json created by DllPlugin shows no reference to module c. But, if you run a method of the dll which actually consumes that module – it works fine, meaning that our library is able to load it’s chunked part, but for some reason it does not expose it to library consumers, which is unexpected.

Author: Fantashit

1 thought on “Can’t import a chunk from dll

  1. @evilebottnawi it still does. I’m looking forward for Federated modules coming in webpack 5, so this issue might become obsolete.

Comments are closed.