{"action":"created","issue":{"url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack/issues/11","repository_url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack","labels_url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack/issues/11/comments","events_url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack/issues/11/events","html_url":"https://github.com/halt-hammerzeit/universal-webpack/issues/11","id":164520363,"number":11,"title":"Error: [universal-webpack] Your server source file must export a function","user":{"login":"aight8","id":1138623,"avatar_url":"https://avatars.githubusercontent.com/u/1138623?v=3","gravatar_id":"","url":"https://api.github.com/users/aight8","html_url":"https://github.com/aight8","followers_url":"https://api.github.com/users/aight8/followers","following_url":"https://api.github.com/users/aight8/following{/other_user}","gists_url":"https://api.github.com/users/aight8/gists{/gist_id}","starred_url":"https://api.github.com/users/aight8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aight8/subscriptions","organizations_url":"https://api.github.com/users/aight8/orgs","repos_url":"https://api.github.com/users/aight8/repos","events_url":"https://api.github.com/users/aight8/events{/privacy}","received_events_url":"https://api.github.com/users/aight8/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-07-08T12:26:45Z","updated_at":"2016-07-08T16:45:25Z","closed_at":null,"body":"I try to start the server build server like following:\r\n```\r\nnodemon -L ./start-server.js --exec babel-node --watch ./build/server\r\n```\r\n\r\nThe server.js (built with webpack located in ./build/server/server.js) have a special webpack exported format and start-server.js and universal-webpack/server.js run in a normal node environment and tries to include the buit server.js here\r\n```\r\nhttps://github.com/halt-hammerzeit/universal-webpack/blob/master/source/server.js#L41\r\n```\r\n\r\nThe result is that the \"starter\" variable become following:\r\n```\r\n[ 0, 1 ]\r\n```\r\n\r\nWhat did I miss?"},"comment":{"url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack/issues/comments/231410685","html_url":"https://github.com/halt-hammerzeit/universal-webpack/issues/11#issuecomment-231410685","issue_url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack/issues/11","id":231410685,"user":{"login":"aight8","id":1138623,"avatar_url":"https://avatars.githubusercontent.com/u/1138623?v=3","gravatar_id":"","url":"https://api.github.com/users/aight8","html_url":"https://github.com/aight8","followers_url":"https://api.github.com/users/aight8/followers","following_url":"https://api.github.com/users/aight8/following{/other_user}","gists_url":"https://api.github.com/users/aight8/gists{/gist_id}","starred_url":"https://api.github.com/users/aight8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aight8/subscriptions","organizations_url":"https://api.github.com/users/aight8/orgs","repos_url":"https://api.github.com/users/aight8/repos","events_url":"https://api.github.com/users/aight8/events{/privacy}","received_events_url":"https://api.github.com/users/aight8/received_events","type":"User","site_admin":false},"created_at":"2016-07-08T16:45:25Z","updated_at":"2016-07-08T16:45:25Z","body":"**webpack.config.js:**\r\n\r\n```JS\r\nimport path from 'path';\r\nimport process from 'process';\r\nimport webpack from 'webpack';\r\nimport ExtractTextPlugin from 'extract-text-webpack-plugin';\r\nconst extractStyle = new ExtractTextPlugin('[name].css', { allChunks: true });\r\n\r\nconst root_folder = path.resolve(__dirname, '..');\r\nconst src_folder = path.resolve(__dirname, 'src');\r\n\r\nconst alias = {\r\n  actions: path.resolve(src_folder, 'actions'),\r\n  app: path.resolve(src_folder, 'app'),\r\n  lib: path.resolve(src_folder, 'lib'),\r\n  pages: path.resolve(src_folder, 'pages'),\r\n  reducers: path.resolve(src_folder, 'reducers'),\r\n  sagas: path.resolve(src_folder, 'sagas'),\r\n  scss: path.resolve(src_folder, 'scss'),\r\n  selectors: path.resolve(src_folder, 'selectors'),\r\n  foundation: path.resolve(__dirname, 'node_modules', 'foundation-sites', 'js'),\r\n};\r\n\r\nlet plugins = [\r\n  new webpack.optimize.CommonsChunkPlugin({\r\n    name: 'vendor',\r\n  }),\r\n  new webpack.ProvidePlugin({\r\n    React: 'react',\r\n    Immutable: 'seamless-immutable',\r\n    pureRender: 'pure-render-decorator',\r\n    autobind: 'autobind-decorator',\r\n  }),\r\n  extractStyle,\r\n];\r\n\r\nif (process.env.NODE_ENV === 'production') {\r\n  plugins.push(new webpack.optimize.UglifyJsPlugin({\r\n    compress: {\r\n      warnings: false,\r\n    },\r\n  }));\r\n}\r\n\r\nexport default {\r\n  context: __dirname,\r\n  entry: {\r\n    app: path.resolve(src_folder, 'app.jsx'),\r\n    vendor: [\r\n      'babel-polyfill',\r\n      'react-dom',\r\n      'react',\r\n      'redux',\r\n      'redux-saga',\r\n      'moment',\r\n      'seamless-immutable',\r\n      'redux-form',\r\n    ],\r\n  },\r\n  output: {\r\n    path: path.resolve(root_folder, 'public', 'assets'),\r\n    //publicPath: '/assets/',\r\n    publicPath: 'http://127.0.0.1:8080/assets/',\r\n    filename: '[name].bundle.js',\r\n    chunkFilename: '[name].[hash].chunk.js',\r\n    sourceMapFilename: '[file].map',\r\n  },\r\n  resolve: {\r\n    extensions: ['', '.js', '.jsx'],\r\n    //root: path.resolve(__dirname, 'src'), // webpack 1\r\n    alias,\r\n    /*modules: [ // webpack 2\r\n      path.resolve(__dirname, 'app'),\r\n      'node_modules',\r\n    ],*/\r\n  },\r\n  module: {\r\n    loaders: [\r\n      {\r\n        test: /app\\.scss$/,\r\n        loader: extractStyle.extract(['css', 'sass']),\r\n      },\r\n      {\r\n        test: /\\.scss$/,\r\n        loaders: ['style', 'css', 'sass'],\r\n        exclude: [path.resolve(__dirname, 'src', 'scss', 'app.scss')],\r\n      },\r\n      {\r\n        test: /\\.less$/,\r\n        loaders: ['style', 'css', 'less'],\r\n      },\r\n      {\r\n        test: /\\.jsx?$/,\r\n        loader: 'babel',\r\n        include: [\r\n          path.resolve(__dirname, 'src'),\r\n          path.resolve(__dirname, 'node_modules', 'lodash-es'),\r\n        ],\r\n      },\r\n      {\r\n        test: /\\.css$/,\r\n        loaders: ['style', 'css'],\r\n      },\r\n      {\r\n        test: /\\.(ico|gif|png|jpe?g)$/,\r\n        loaders: [\r\n          'url?limit=5000&name=rsrc/img/[name].[ext]&mimeType=image/[ext]',\r\n          'image-webpack?{progressive:true, optimizationLevel: 7, interlaced: false, pngquant:{quality: \"25-80\", speed: 10}}'\r\n        ]\r\n      },\r\n      {\r\n        test: /\\.(svg|ttf|eot|woff(2)?)(\\?v=[0-9]\\.[0-9]\\.[0-9])?$/,\r\n        loaders: ['file'],\r\n      }\r\n    ]\r\n  },\r\n  sassLoader: {\r\n    includePaths: [\r\n      path.resolve(__dirname, 'src', 'scss', 'shared'),\r\n    ],\r\n  },\r\n  progress: true,\r\n  plugins,\r\n};\r\n\r\n```"}}
{"actor":{"display_login":"aight8"}}