{"action":"created","issue":{"url":"https://api.github.com/repos/zeit/next.js/issues/468","repository_url":"https://api.github.com/repos/zeit/next.js","labels_url":"https://api.github.com/repos/zeit/next.js/issues/468/labels{/name}","comments_url":"https://api.github.com/repos/zeit/next.js/issues/468/comments","events_url":"https://api.github.com/repos/zeit/next.js/issues/468/events","html_url":"https://github.com/zeit/next.js/issues/468","id":197084537,"number":468,"title":"`Error: Cannot find module 'next.config.js'`","user":{"login":"rike422","id":3284018,"avatar_url":"https://avatars.githubusercontent.com/u/3284018?v=3","gravatar_id":"","url":"https://api.github.com/users/rike422","html_url":"https://github.com/rike422","followers_url":"https://api.github.com/users/rike422/followers","following_url":"https://api.github.com/users/rike422/following{/other_user}","gists_url":"https://api.github.com/users/rike422/gists{/gist_id}","starred_url":"https://api.github.com/users/rike422/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rike422/subscriptions","organizations_url":"https://api.github.com/users/rike422/orgs","repos_url":"https://api.github.com/users/rike422/repos","events_url":"https://api.github.com/users/rike422/events{/privacy}","received_events_url":"https://api.github.com/users/rike422/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-22T03:04:31Z","updated_at":"2016-12-22T03:38:05Z","closed_at":null,"body":"When am trying to start custom server and `next.config.js` Its raise an error\r\n\r\n```\r\n[11:54:30] _(master)_ > next dev\r\n// console.log(dir) inserted to https://github.com/zeit/next.js/blob/master/server/config.js#L19\r\ndir = /Users/username/dev/js/test-next\r\n// console.log(path) inserted to https://github.com/zeit/next.js/blob/master/server/config.js#L22\r\npath = /Users/username/dev/js/test-next/next.config.js\r\n```\r\n\r\n```\r\n[11:56:05] _(master)_ > node server.js\r\n// console.log(dir) inserted to https://github.com/zeit/next.js/blob/master/server/config.js#L19\r\ndir = .\r\n// console.log(path) inserted to https://github.com/zeit/next.js/blob/master/server/config.js#L22\r\npath = next.config.js\r\nmodule.js:442\r\n    throw err;\r\n    ^\r\nError: Cannot find module 'next.config.js'\r\n    at Function.Module._resolveFilename (module.js:440:15)\r\n    at Function.Module._load (module.js:388:25)\r\n    at Module.require (module.js:468:17)\r\n    at require (internal/module.js:20:19)\r\n    at loadConfig (/Users/akiratakahashi/dev/js/test-next/node_modules/next/dist/server/config.js:45:28)\r\n    at getConfig (/Users/akiratakahashi/dev/js/test-next/node_modules/next/dist/server/config.js:32:20)\r\n    at new Server (/Users/akiratakahashi/dev/js/test-next/node_modules/next/dist/server/index.js:86:40)\r\n    at module.exports (/Users/akiratakahashi/dev/js/test-next/node_modules/next/dist/server/next.js:10:10)\r\n    at Object.<anonymous> (/Users/akiratakahashi/dev/js/test-next/server.js:4:13)\r\n    at Module._compile (module.js:541:32)\r\n```\r\n\r\nserver.js\r\n```js\r\nconst express = require('express')\r\nconst next = require('next')\r\nconst accepts = require('accepts')\r\nconst app = next({ dev: true })\r\nconst handle = app.getRequestHandler()\r\n\r\napp.prepare()\r\n  .then(() => {\r\n    const server = express()\r\n\r\n    server.use((req, res, next) => {\r\n      const accept = accepts(req)\r\n      const type = accept.type(['json', 'html'])\r\n      if (type === 'json') {\r\n        return handle(req, res)\r\n      }\r\n      next()\r\n    })\r\n\r\n    server.get('/a', (req, res) => {\r\n      return app.render(req, res, '/b', req.query)\r\n    })\r\n\r\n    server.get('*', (req, res) => {\r\n      return handle(req, res)\r\n    })\r\n\r\n    server.listen(3000)\r\n  })\r\n```"},"comment":{"url":"https://api.github.com/repos/zeit/next.js/issues/comments/268710708","html_url":"https://github.com/zeit/next.js/issues/468#issuecomment-268710708","issue_url":"https://api.github.com/repos/zeit/next.js/issues/468","id":268710708,"user":{"login":"rike422","id":3284018,"avatar_url":"https://avatars.githubusercontent.com/u/3284018?v=3","gravatar_id":"","url":"https://api.github.com/users/rike422","html_url":"https://github.com/rike422","followers_url":"https://api.github.com/users/rike422/followers","following_url":"https://api.github.com/users/rike422/following{/other_user}","gists_url":"https://api.github.com/users/rike422/gists{/gist_id}","starred_url":"https://api.github.com/users/rike422/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rike422/subscriptions","organizations_url":"https://api.github.com/users/rike422/orgs","repos_url":"https://api.github.com/users/rike422/repos","events_url":"https://api.github.com/users/rike422/events{/privacy}","received_events_url":"https://api.github.com/users/rike422/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T03:38:05Z","updated_at":"2016-12-22T03:38:05Z","body":"Resolved.\r\nAfter changing as below, no error occurred.\r\n\r\n`const app = next({ dev: true })` and \r\n to \r\n`const app = next({ dev: true, dir: process.cwd() })`"}}
{"actor":{"display_login":"rike422"}}