NamedModulesPlugin produces colliding module ids

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

Bug, probably the cause for boopathi/react-svg-loader#197

What is the current behavior?

Webpack links modules differently in development mode then in production mode depending on the loader configuration.

If I have two importing modules:

// checkA.js
import A from "./other.js";
// checkB.js
import B from "./other.js";

and apply two different loader configurations on other.js like

    module: {
        rules: [
            {
                include: require.resolve("./src/other.js"),
                issuer: require.resolve("./src/checkA.js"),
                use: require.resolve("./loaders/a.js")
            },
            {
                include: require.resolve("./src/other.js"),
                issuer: require.resolve("./src/checkB.js"),
                use: require.resolve("./loaders/b.js")
            }
        ]
    },

checkB.js receives the loader result from loaders/a.js

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

https://github.com/jhnns/webpack-multi-loader-bug

What is the expected behavior?

checkA and checkB should receive different results depending on their loader configuration

Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.

The problem probably exists in older webpack versions. But with webpack 4, it has becoming more urgent since the NamedModulesPlugin is applied by default in development mode.

Author: Fantashit

1 thought on “NamedModulesPlugin produces colliding module ids

Comments are closed.