Skip to content

Error: Conflict: Multiple chunks emit assets to the same filename ssr-bundle.js #29

@edwardfxiao

Description

@edwardfxiao

Hi, I have encountered this problem when I was trying to create multiple html files with multiple entries.

Error: Child compilation failed:
  Error: Conflict: Multiple chunks emit assets to the same filename ssr-bundle.js (chunks 1 and 2  )
//webpack config
config.entry = {
  a: './a.js',
  b: './b.js',
}

Object.keys(config.entry).map(i => {
  config.plugins.push(
    new HtmlWebpackPlugin({
      template: `!!prerender-loader?string!./template.html`,
      filename: `${i}.html`,
      hash: false,
      chunks: [i],
    }),
  );
});

I have tried below but doesnt make any difference.

template: `!!prerender-loader?${JSON.stringify({ string: true, params: { url: `/${i}/` } })}!./template.html`
        "html-webpack-plugin": "^4.0.0-alpha.2",
        "prerender-loader": "^1.2.0",
        "webpack": "^4.29.3",
        "webpack-assets-manifest": "^2.0.0",
        "webpack-cli": "^3.1.1",
        "webpack-dev-server": "^3.1.14"

node v11.9.0.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions