Skip to content

Webpack 5.beta.11: HMR error Cannot read property 'getModuleIndex2' of undefined #487

Closed
@Levdbas

Description

@Levdbas
  • Operating System:
  • Node Version: 13.3
  • NPM Version: 6.13.1
  • webpack Version: 5.0.0-beta.11
  • mini-css-extract-plugin Version: 0.9

HMR code

{
                        loader: MiniCssExtractPlugin.loader,
                        options: {
                            publicPath: '../',
                            sourceMap: CreateSourceMap,
                            hmr: watchMode,
                            reloadAll: true,
                        },
                    },

Expected Behavior

  1. Run webpack in watchmode with HMR
  2. compile css, no issue
  3. rerun, no issue :)

Actual Behavior

  1. Run webpack in watchmode with HMR
  2. compile css, no issue
  3. rerun, issue :(

TypeError: Cannot read property 'getModuleIndex2' of undefined at MiniCssExtractPlugin.renderContentAsset ([...]/node_modules/mini-css-extract-plugin/dist/index.js:301:27)

It seems that getModuleIndex2 is deprecated in webpack 5. I don't know if this plugin is already compatible. If needed I can create a repo with minimal code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions