{"action":"created","issue":{"url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack/issues/34","repository_url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack","labels_url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack/issues/34/comments","events_url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack/issues/34/events","html_url":"https://github.com/halt-hammerzeit/universal-webpack/issues/34","id":182741110,"number":34,"title":"import token from .scss file illegal","user":{"login":"ngoctranfire","id":3119704,"avatar_url":"https://avatars.githubusercontent.com/u/3119704?v=3","gravatar_id":"","url":"https://api.github.com/users/ngoctranfire","html_url":"https://github.com/ngoctranfire","followers_url":"https://api.github.com/users/ngoctranfire/followers","following_url":"https://api.github.com/users/ngoctranfire/following{/other_user}","gists_url":"https://api.github.com/users/ngoctranfire/gists{/gist_id}","starred_url":"https://api.github.com/users/ngoctranfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngoctranfire/subscriptions","organizations_url":"https://api.github.com/users/ngoctranfire/orgs","repos_url":"https://api.github.com/users/ngoctranfire/repos","events_url":"https://api.github.com/users/ngoctranfire/events{/privacy}","received_events_url":"https://api.github.com/users/ngoctranfire/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-10-13T09:36:39Z","updated_at":"2016-10-13T11:13:12Z","closed_at":"2016-10-13T11:13:01Z","body":"I keep running into this error. This is my start-server.js file.\r\n```js\r\nconst { server } = require('universal-webpack');\r\nconst settings = require('./config/universal-webpack-settings');\r\nconst serverConfig = require('./config/webpack.config.server');\r\n\r\nserver(serverConfig, settings);\r\n```\r\nThis is my settings file:\r\n\r\n```js\r\nconst { DIST, SRC } = require('./paths');\r\nconst path = require('path');\r\n\r\nmodule.exports = {\r\n  server:\r\n  {\r\n    input: path.join(SRC, 'server-entry.js'),\r\n    output: path.join(DIST, 'server.js')\r\n  }\r\n};\r\n\r\n```\r\nThis is my server-entry.js file. If i comment out the require('./server/server.js'), and the setupServer() part, it will work flawlessly, but I need that setupServer part.\r\n```js\r\nrequire('babel-polyfill');\r\nimport express from 'express';\r\nimport SwaggerExpress from 'swagger-express-mw';\r\n\r\nimport {SWAGGER} from './config/paths';\r\nimport './config/environment';\r\n\r\nfunction startServer (parameters) {\r\n  const app = express();\r\n\r\n  var config = {\r\n    appRoot: SWAGGER\r\n  };\r\n  SwaggerExpress.create(config, (err, swaggerExpress) => {\r\n    if (err) {\r\n      throw err;\r\n    }\r\n    const setupServer = require('./server/server');\r\n    // This installs the middleware\r\n    swaggerExpress.register(app);\r\n    setupServer(app);\r\n\r\n    app.listen(process.env.PORT, () => {\r\n      console.log(`listening at http://localhost:${process.env.PORT}`); // eslint-disable-line\r\n    });\r\n\r\n  });\r\n}\r\n\r\nmodule.exports = startServer;\r\n\r\n```\r\nHere is my setupSever.js file\r\n```js\r\nimport React from 'react';\r\nimport { renderToString } from 'react-dom/server';\r\nimport express from 'express';\r\nimport debug from 'debug';\r\nimport morgan from 'morgan';\r\n\r\nimport compression from 'compression';\r\nimport Error500 from './templates/Error500';\r\nimport { routingApp, setRoutes } from './router';\r\nimport initFirebase from './api/firebase';\r\n\r\nconst setUpServer = (server, assets) => {\r\n  const log = debug('preact-lego.js, setting up server.js');\r\n  log('starting');\r\n  initFirebase();\r\n\r\n  server.set('etag', true);\r\n  server.use((req, res, next) => {\r\n    res.header('Cache-Control', 'no-cache, no-store, must-revalidate');\r\n    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');\r\n    res.header('Pragma', 'no-cache');\r\n    res.header('Expires', 0);\r\n    next();\r\n  });\r\n  server.use(morgan('combined'));\r\n  server.use(compression());\r\n  server.enable('view cache');\r\n  server.enable('strict routing');\r\n\r\n  Object.assign(express.response, {\r\n    renderPageToString(page) {\r\n      return `<!doctype html>${renderToString(page)}`;\r\n    },\r\n    render500(e) {\r\n      console.log(\" This is a 500 error\", e);\r\n      log('render500', e);\r\n      this.status(500).send(this.renderPageToString(<Error500 />));\r\n    }\r\n  });\r\n  server.use('/', routingApp);\r\n\r\n  setRoutes(assets);\r\n};\r\nexport default setUpServer;\r\n```\r\n```\r\n/node_modules/react-toolbox/lib/ripple/theme.scss:1\r\n(function (exports, require, module, __filename, __dirname) { @import \"../colors\";\r\n                                                                                                 ^\r\nSyntaxError: Unexpected token ILLEGAL\r\n    at exports.runInThisContext (vm.js:53:16)\r\n    at Module._compile (module.js:511:25)\r\n    at Object.Module._extensions..js (module.js:550:10)\r\n    at Module.load (module.js:456:32)\r\n    at tryModuleLoad (module.js:415:12)\r\n    at Function.Module._load (module.js:407:3)\r\n    at Module.require (module.js:466:17)\r\n    at require (internal/module.js:20:19)\r\n    at Object.<anonymous> (.........../node_modules/react-toolbox/lib/ripple/index.js:13:14)\r\n    at Module._compile (module.js:541:32)\r\nSyntaxError: Unexpected token ILLEGAL\r\n    at exports.runInThisContext (vm.js:53:16)\r\n    at Module._compile (module.js:511:25)\r\n    at Object.Module._extensions..js (module.js:550:10)\r\n    at Module.load (module.js:456:32)\r\n    at tryModuleLoad (module.js:415:12)\r\n    at Function.Module._load (module.js:407:3)\r\n    at Module.require (module.js:466:17)\r\n    at require (internal/module.js:20:19)\r\n    at Object.<anonymous> (...../node_modules/react-toolbox/lib/ripple/index.js:13:14)\r\n    at Module._compile (module.js:541:32)\r\n```\r\nAlso, this is my package.json file and I'm currently running npm run start:dev:\r\n```\r\n \"build:dev\": \"NODE_CONFIG_DIR=src/config NODE_ENV=development webpack-dev-server --hot --inline --config src/config/webpack.config.dev.js --port 3001\",\r\n    \"build:server\": \"NODE_CONFIG_DIR=src/config webpack --config src/config/webpack.config.server.js\",\r\n    \"start\": \"NODE_CONFIG_DIR=src/config NODE_ENV=production node compiled/server.js\",\r\n    \"start:dev\": \"NODE_CONFIG_DIR=src/config npm-run-all --parallel build:dev build:server development-server\",\r\n    \"development-server\": \"NODE_CONFIG_DIR=src/config nodemon src/start-server.js --watch compiled/dist --ignore src/app --exec babel-node\",\r\n    \"prep-server\": \"universal-webpack --settings src/config/universal-webpack-settings.js\",\r\n\r\n```\r\nCan you help me figure out what is going on?"},"comment":{"url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack/issues/comments/253484562","html_url":"https://github.com/halt-hammerzeit/universal-webpack/issues/34#issuecomment-253484562","issue_url":"https://api.github.com/repos/halt-hammerzeit/universal-webpack/issues/34","id":253484562,"user":{"login":"ngoctranfire","id":3119704,"avatar_url":"https://avatars.githubusercontent.com/u/3119704?v=3","gravatar_id":"","url":"https://api.github.com/users/ngoctranfire","html_url":"https://github.com/ngoctranfire","followers_url":"https://api.github.com/users/ngoctranfire/followers","following_url":"https://api.github.com/users/ngoctranfire/following{/other_user}","gists_url":"https://api.github.com/users/ngoctranfire/gists{/gist_id}","starred_url":"https://api.github.com/users/ngoctranfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngoctranfire/subscriptions","organizations_url":"https://api.github.com/users/ngoctranfire/orgs","repos_url":"https://api.github.com/users/ngoctranfire/repos","events_url":"https://api.github.com/users/ngoctranfire/events{/privacy}","received_events_url":"https://api.github.com/users/ngoctranfire/received_events","type":"User","site_admin":false},"created_at":"2016-10-13T11:13:12Z","updated_at":"2016-10-13T11:13:12Z","body":"Basically, I think you misunderstood because I had a bad naming convention. I imported that ./server/server.js file, but all that file is just a setup configurations file for my server.\r\n\r\nIf I take tha tout, it would look something like this:\r\n\r\n\r\nrequire('babel-polyfill');\r\nimport SwaggerExpress from 'swagger-express-mw';\r\n\r\nimport {SWAGGER} from './config/paths';\r\nimport './config/environment';\r\n\r\nimport React from 'react';\r\nimport { renderToString } from 'react-dom/server';\r\nimport express from 'express';\r\nimport debug from 'debug';\r\nimport morgan from 'morgan';\r\n\r\nimport compression from 'compression';\r\nimport Error500 from './server/templates/Error500';\r\nimport { routingApp, setRoutes } from './server/router';\r\nimport initFirebase from './server/api/firebase';\r\n\r\nconst setUpServer = (server, assets) => {\r\n  const log = debug('project-landing:server.js, setting up server.js');\r\n  log('starting');\r\n  initFirebase();\r\n\r\n  server.set('etag', true);\r\n  server.use((req, res, next) => {\r\n    res.header('Cache-Control', 'no-cache, no-store, must-revalidate');\r\n    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');\r\n    res.header('Pragma', 'no-cache');\r\n    res.header('Expires', 0);\r\n    next();\r\n  });\r\n  server.use(morgan('combined'));\r\n  server.use(compression());\r\n  server.enable('view cache');\r\n  server.enable('strict routing');\r\n\r\n  Object.assign(express.response, {\r\n    renderPageToString(page) {\r\n      return `<!doctype html>${renderToString(page)}`;\r\n    },\r\n    render500(e) {\r\n      console.log(\" This is a 500 error\", e);\r\n      log('render500', e);\r\n      this.status(500).send(this.renderPageToString(<Error500 />));\r\n    }\r\n  });\r\n  server.use('/', routingApp);\r\n\r\n  setRoutes(assets);\r\n};\r\n\r\nfunction startServer (parameters) {\r\n  // console.log(\"These are my parameters\", parameters.chunks());\r\n\r\n  var config = {\r\n    appRoot: SWAGGER\r\n  };\r\n  SwaggerExpress.create(config, (err, swaggerExpress) => {\r\n    if (err) {\r\n      throw err;\r\n    }\r\n    const app = express();\r\n    // This installs the middleware\r\n    swaggerExpress.register(app);\r\n    setUpServer(app, parameters.chunks());\r\n\r\n    app.listen(process.env.PORT, () => {\r\n      console.log(`listening at http://localhost:${process.env.PORT}`); // eslint-disable-line\r\n    });\r\n\r\n  });\r\n}\r\n\r\nmodule.exports = startServer;\r\n"}}
{"actor":{"display_login":"ngoctranfire"}}