{"record":{"id":"a3d3984ad9c266f7","repo":"Meituan-Dianping/mpvue","slug":"server-side-bundle-should-have-one-single-entry-fi","errorCode":null,"errorMessage":"Server-side bundle should have one single entry file. Avoid using CommonsChunkPlugin in the server config.","messagePattern":"Server-side bundle should have one single entry file\\. Avoid using CommonsChunkPlugin in the server config\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/server/webpack-plugin/server.js","lineNumber":26,"sourceCode":"  }\n\n  apply (compiler) {\n    validate(compiler)\n\n    compiler.plugin('emit', (compilation, cb) => {\n      const stats = compilation.getStats().toJson()\n      const entryName = Object.keys(stats.entrypoints)[0]\n      const entryInfo = stats.entrypoints[entryName]\n\n      if (!entryInfo) {\n        // #5553\n        return cb()\n      }\n\n      const entryAssets = entryInfo.assets.filter(isJS)\n\n      if (entryAssets.length > 1) {\n        throw new Error(\n          `Server-side bundle should have one single entry file. ` +\n          `Avoid using CommonsChunkPlugin in the server config.`\n        )\n      }\n\n      const entry = entryAssets[0]\n      if (!entry || typeof entry !== 'string') {\n        throw new Error(\n          `Entry \"${entryName}\" not found. Did you specify the correct entry option?`\n        )\n      }\n\n      const bundle = {\n        entry,\n        files: {},\n        maps: {}\n      }\n","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/server/webpack-plugin/server.js#L8-L44","documentation":"Guard thrown by the SSR server webpack plugin during the emit hook when the compiled server bundle exposes more than one JS entry asset. The server renderer expects exactly one self-contained entry file; code splitting plugins like CommonsChunkPlugin split the server bundle in ways the renderer cannot load, so the configuration is rejected at build time.","triggerScenarios":"Thrown at src/server/webpack-plugin/server.js:26 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove CommonsChunkPlugin (or splitChunks) from the webpack server config","Keep the server bundle as a single entry, targeting node with library Target: 'node'","Move shared-chunk optimization to the client config only"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b","analyzedAt":"2026-09-02T05:17:40.946Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}