{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/vue-ssr-docs/issues/131","repository_url":"https://api.github.com/repos/vuejs/vue-ssr-docs","labels_url":"https://api.github.com/repos/vuejs/vue-ssr-docs/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vue-ssr-docs/issues/131/comments","events_url":"https://api.github.com/repos/vuejs/vue-ssr-docs/issues/131/events","html_url":"https://github.com/vuejs/vue-ssr-docs/issues/131","id":258287637,"node_id":"MDU6SXNzdWUyNTgyODc2Mzc=","number":131,"title":"I am having problems on building the entry-server.js","user":{"login":"raultrysw","id":7994416,"node_id":"MDQ6VXNlcjc5OTQ0MTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7994416?v=4","gravatar_id":"","url":"https://api.github.com/users/raultrysw","html_url":"https://github.com/raultrysw","followers_url":"https://api.github.com/users/raultrysw/followers","following_url":"https://api.github.com/users/raultrysw/following{/other_user}","gists_url":"https://api.github.com/users/raultrysw/gists{/gist_id}","starred_url":"https://api.github.com/users/raultrysw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raultrysw/subscriptions","organizations_url":"https://api.github.com/users/raultrysw/orgs","repos_url":"https://api.github.com/users/raultrysw/repos","events_url":"https://api.github.com/users/raultrysw/events{/privacy}","received_events_url":"https://api.github.com/users/raultrysw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-17T08:13:27Z","updated_at":"2018-09-06T10:15:00Z","closed_at":null,"author_association":"NONE","body":"Hi, i dont know if it is the apropiate site to issue this problem but I didnt where to issue this.\r\n\r\nMy problem is that when I run webpack --config bundler/webpack/webpack-server.config.js for get the bundle of entry server the build process throws me this error:\r\n```\r\n/home/raul/Documentos/Workshop/vuejs website template/node_modules/vue-server-renderer/server-plugin.js:58\r\n      throw new Error(\r\n      ^\r\n\r\nError: Server-side bundle should have one single entry file. Avoid using CommonsChunkPlugin in the server config.\r\n    at Compiler.<anonymous> (/home/raul/Documentos/Workshop/vuejs website template/node_modules/vue-server-renderer/server-plugin.js:58:13)\r\n    at Compiler.applyPluginsAsyncSeries (/home/raul/Documentos/Workshop/vuejs website template/node_modules/tapable/lib/Tapable.js:206:13)\r\n    at Compiler.emitAssets (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/Compiler.js:358:8)\r\n    at onCompiled (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/Compiler.js:244:9)\r\n    at applyPluginsAsync.err (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/Compiler.js:514:14)\r\n    at next (/home/raul/Documentos/Workshop/vuejs website template/node_modules/tapable/lib/Tapable.js:202:11)\r\n    at Compiler.<anonymous> (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/CachePlugin.js:78:5)\r\n    at Compiler.applyPluginsAsyncSeries (/home/raul/Documentos/Workshop/vuejs website template/node_modules/tapable/lib/Tapable.js:206:13)\r\n    at compilation.seal.err (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/Compiler.js:511:11)\r\n    at Compilation.applyPluginsAsyncSeries (/home/raul/Documentos/Workshop/vuejs website template/node_modules/tapable/lib/Tapable.js:195:46)\r\n    at self.applyPluginsAsync.err (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/Compilation.js:671:19)\r\n    at Compilation.applyPluginsAsyncSeries (/home/raul/Documentos/Workshop/vuejs website template/node_modules/tapable/lib/Tapable.js:195:46)\r\n    at self.applyPluginsAsync.err (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/Compilation.js:662:11)\r\n    at Compilation.applyPluginsAsyncSeries (/home/raul/Documentos/Workshop/vuejs website template/node_modules/tapable/lib/Tapable.js:195:46)\r\n    at self.applyPluginsAsync.err (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/Compilation.js:657:10)\r\n    at Compilation.applyPluginsAsyncSeries (/home/raul/Documentos/Workshop/vuejs website template/node_modules/tapable/lib/Tapable.js:195:46)\r\n    at sealPart2 (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/Compilation.js:653:9)\r\n    at Compilation.applyPluginsAsyncSeries (/home/raul/Documentos/Workshop/vuejs website template/node_modules/tapable/lib/Tapable.js:195:46)\r\n    at Compilation.seal (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/Compilation.js:596:8)\r\n    at applyPluginsParallel.err (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/Compiler.js:508:17)\r\n    at /home/raul/Documentos/Workshop/vuejs website template/node_modules/tapable/lib/Tapable.js:289:11\r\n    at _addModuleChain (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/Compilation.js:498:11)\r\n    at processModuleDependencies.err (/home/raul/Documentos/Workshop/vuejs website template/node_modules/webpack/lib/Compilation.js:468:14)\r\n    at _combinedTickCallback (internal/process/next_tick.js:73:7)\r\n    at process._tickCallback (internal/process/next_tick.js:104:9)\r\n````\r\n\r\nI dont know what to do... Watching the documentation doesn't helps me...\r\n\r\nThis are the webpacks files:\r\n\r\nwebpack-base.config.js\r\n```\r\nconst webpack = require('webpack')\r\nconst ExtractTextPlugin = require('extract-text-webpack-plugin')\r\n\r\nconst isProduction = process.env.NODE_ENV === 'production'\r\n\r\nmodule.exports = {\r\n    module: {\r\n        rules: [\r\n          {\r\n            test: /\\.vue$/,\r\n            loader: 'vue-loader',\r\n            options: {\r\n              // enable CSS extraction\r\n              extractCSS: isProduction\r\n            }\r\n          },\r\n          {\r\n            test: /\\.css$/,\r\n            // important: use vue-style-loader instead of style-loader\r\n            use: isProduction\r\n              ? ExtractTextPlugin.extract({\r\n                  use: 'css-loader',\r\n                  fallback: 'vue-style-loader'\r\n                })\r\n              : ['vue-style-loader', 'css-loader']\r\n          }\r\n          // ...\r\n        ]\r\n      },\r\n      plugins: [\r\n        // it is common to extract deps into a vendor chunk for better caching.\r\n        new webpack.optimize.CommonsChunkPlugin({\r\n          name: 'vendor',\r\n          minChunks: function (module) {\r\n            // a module is extracted into the vendor chunk when...\r\n            return (\r\n              // if it's inside node_modules\r\n              /node_modules/.test(module.context) &&\r\n              // do not externalize if the request is a CSS file\r\n              !/\\.css$/.test(module.request)\r\n            )\r\n          }\r\n        }),\r\n        // extract webpack runtime & manifest\r\n        new webpack.optimize.CommonsChunkPlugin({\r\n          name: 'manifest'\r\n        }),\r\n      ]\r\n};\r\n```\r\n\r\nwebpck-server.config.js\r\n```\r\nconst webpack = require('webpack')\r\nconst merge = require('webpack-merge')\r\nconst baseConfig = require('./webpack-base.config.js')\r\nconst VueSSRServerPlugin = require('vue-server-renderer/server-plugin')\r\nconst nodeExternals = require('webpack-node-externals')\r\n\r\nmodule.exports = merge(baseConfig, {\r\n  // Point entry to your app's server entry file\r\n  entry: __dirname + '/../entries/entry-server.js',\r\n\r\n  // This allows webpack to handle dynamic imports in a Node-appropriate\r\n  // fashion, and also tells `vue-loader` to emit server-oriented code when\r\n  // compiling Vue components.\r\n  target: 'node',\r\n\r\n  // For bundle renderer source map support\r\n  devtool: 'source-map',\r\n\r\n  // This tells the server bundle to use Node-style exports\r\n  output: {\r\n    libraryTarget: 'commonjs2',\r\n    filename: '[name].bundle.js',\r\n    path: __dirname + '/../../server-bundles/'\r\n  },\r\n\r\n  // https://webpack.js.org/configuration/externals/#function\r\n  // https://github.com/liady/webpack-node-externals\r\n  // Externalize app dependencies. This makes the server build much faster\r\n  // and generates a smaller bundle file.\r\n  externals: nodeExternals({\r\n    // do not externalize dependencies that need to be processed by webpack.\r\n    // you can add more file types here e.g. raw *.vue files\r\n    // you should also whitelist deps that modifies `global` (e.g. polyfills)\r\n    whitelist: /\\.css$/\r\n  }),\r\n\r\n  // This is the plugin that turns the entire output of the server build\r\n  // into a single JSON file. The default file name will be\r\n  // `vue-ssr-server-bundle.json`\r\n  plugins: [\r\n    new VueSSRServerPlugin()\r\n  ]\r\n})\r\n```\r\n\r\nwebpack-client.config.js\r\n```\r\nconst webpack = require('webpack')\r\nconst merge = require('webpack-merge')\r\nconst nodeExternals = require('webpack-node-externals')\r\nconst baseConfig = require('./webpack-base.config.js')\r\nconst VueSSRClientPlugin = require('vue-server-renderer/client-plugin')\r\n\r\nmodule.exports = merge(baseConfig, {\r\n  entry: __dirname + '/../entries/entry-client.js',\r\n  output: {\r\n      filename: '[name].bundle.js',\r\n      path: __dirname + '/../../assets/'\r\n  },\r\n  plugins: [\r\n    // Important: this splits the webpack runtime into a leading chunk\r\n    // so that async chunks can be injected right after it.\r\n    // this also enables better caching for your app/vendor code.\r\n    new webpack.optimize.CommonsChunkPlugin({\r\n      name: \"manifest\",\r\n      minChunks: Infinity\r\n    }),\r\n    // This plugins generates `vue-ssr-client-manifest.json` in the\r\n    // output directory.\r\n    new VueSSRClientPlugin()\r\n  ]\r\n})\r\n```\r\n\r\nPlease help =)"},"comment":{"url":"https://api.github.com/repos/vuejs/vue-ssr-docs/issues/comments/419041282","html_url":"https://github.com/vuejs/vue-ssr-docs/issues/131#issuecomment-419041282","issue_url":"https://api.github.com/repos/vuejs/vue-ssr-docs/issues/131","id":419041282,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTA0MTI4Mg==","user":{"login":"anneincoding","id":21570804,"node_id":"MDQ6VXNlcjIxNTcwODA0","avatar_url":"https://avatars1.githubusercontent.com/u/21570804?v=4","gravatar_id":"","url":"https://api.github.com/users/anneincoding","html_url":"https://github.com/anneincoding","followers_url":"https://api.github.com/users/anneincoding/followers","following_url":"https://api.github.com/users/anneincoding/following{/other_user}","gists_url":"https://api.github.com/users/anneincoding/gists{/gist_id}","starred_url":"https://api.github.com/users/anneincoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anneincoding/subscriptions","organizations_url":"https://api.github.com/users/anneincoding/orgs","repos_url":"https://api.github.com/users/anneincoding/repos","events_url":"https://api.github.com/users/anneincoding/events{/privacy}","received_events_url":"https://api.github.com/users/anneincoding/received_events","type":"User","site_admin":false},"created_at":"2018-09-06T10:15:00Z","updated_at":"2018-09-06T10:15:00Z","author_association":"NONE","body":"@947133297  I didn't use  CommonsChunkPlugin , but still face the same problem.\r\n```javascript\r\n'optimization': {\r\n    'splitChunks': {\r\n      'chunks': 'all',\r\n      'cacheGroups': {\r\n        'styles': {\r\n          'name': 'styles',\r\n          'test': /\\.css$/,\r\n          'chunks': 'all',\r\n          'enforce': true\r\n        }\r\n      }\r\n    },\r\n    'runtimeChunk': true,\r\n    'minimize': true\r\n  },\r\n```\r\nmy plugins\r\n\r\n```javascript\r\n'plugins':\r\n    isProd ?\r\n      [\r\n        new VueLoaderPlugin(),\r\n        new MiniCssExtractPlugin({\r\n          'filename': isProd ? '[name].[hash].css' : '[name].css',\r\n          'chunkFilename': isProd ? '[id].[hash].css' : '[id].css'\r\n        })\r\n      ] : [\r\n        new VueLoaderPlugin(),\r\n        new FriendlyErrorsPlugin()\r\n      ]\r\n```\r\n\r\n"}}
{"actor":{"display_login":"anneincoding"}}