{"action":"created","issue":{"url":"https://api.github.com/repos/zeit/next.js/issues/3903","repository_url":"https://api.github.com/repos/zeit/next.js","labels_url":"https://api.github.com/repos/zeit/next.js/issues/3903/labels{/name}","comments_url":"https://api.github.com/repos/zeit/next.js/issues/3903/comments","events_url":"https://api.github.com/repos/zeit/next.js/issues/3903/events","html_url":"https://github.com/zeit/next.js/issues/3903","id":300445954,"number":3903,"title":".next packaged folder contains absolute path, failing on AWS + time out no logs","user":{"login":"Vadorequest","id":3807458,"avatar_url":"https://avatars2.githubusercontent.com/u/3807458?v=4","gravatar_id":"","url":"https://api.github.com/users/Vadorequest","html_url":"https://github.com/Vadorequest","followers_url":"https://api.github.com/users/Vadorequest/followers","following_url":"https://api.github.com/users/Vadorequest/following{/other_user}","gists_url":"https://api.github.com/users/Vadorequest/gists{/gist_id}","starred_url":"https://api.github.com/users/Vadorequest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vadorequest/subscriptions","organizations_url":"https://api.github.com/users/Vadorequest/orgs","repos_url":"https://api.github.com/users/Vadorequest/repos","events_url":"https://api.github.com/users/Vadorequest/events{/privacy}","received_events_url":"https://api.github.com/users/Vadorequest/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-27T00:15:25Z","updated_at":"2018-02-27T08:41:03Z","closed_at":"2018-02-27T08:41:03Z","author_association":"NONE","body":"- [x] I have searched the [issues](https://github.com/zeit/next.js/issues) of this repository and believe that this is not a duplicate.\r\n\r\n## Expected Behavior\r\nI am trying to host Next.js on AWS Lambda/CloudFormation. (using [Serverless](https://github.com/serverless/serverless))\r\n\r\nI am running into two issues:\r\n\r\n1. When I host the packaged version of next (.next folder), it fails on AWS with \r\n    ```\r\n    { Error: Cannot find module '/Users/vadorequest/dev/serverless-with-next/node_modules/next/dist/pages/_document.js'\r\n    at Function.Module._resolveFilename (module.js:469:15)\r\n    at Function.Module._load (module.js:417:25)\r\n    at Module.require (module.js:497:17)\r\n    at require (internal/module.js:20:19)\r\n    at Object.7 (/var/task/.next/dist/bundles/pages/_document.js:86:18)\r\n    at __webpack_require__ (/var/task/.next/dist/bundles/pages/_document.js:23:31)\r\n    at Object.6 (/var/task/.next/dist/bundles/pages/_document.js:78:18)\r\n    at __webpack_require__ (/var/task/.next/dist/bundles/pages/_document.js:23:31)\r\n    at /var/task/.next/dist/bundles/pages/_document.js:70:18\r\n    at Object.<anonymous> (/var/task/.next/dist/bundles/pages/_document.js:73:10) code: 'MODULE_NOT_FOUND' }\r\n     ```\r\n    I don't understand why there are absolute paths used in the generated code. I looked at the content of `.next` folder and there are tons of them, how are we supposed to use this package if it cannot be moved to another system? I cannot compile on AWS lambda. Is there a way of replacing those path programmatically using webpack for instance?\r\n\r\n2. I manually replaced those paths to match AWS, basically replaced `/Users/vadorequest/dev/serverless-with-next` to `/var/task` in the `.next` folder. Once uploaded to AWS and hitting my endpoint `https://bcwl62lv2e.execute-api.us-east-1.amazonaws.com/dev` it loads for 30 seconds and then time out. Logs are empty, I don't know what's happening, at first I assumed the first Next.js load was slow (default timeout 6s) but 30s is way too much and something must be wrong. How can I debug this? Is there a way to configure Next.js to log what it does?\r\n\r\n## Steps to Reproduce (for bugs)\r\n\r\n1. Go to https://github.com/Vadorequest/serverless-with-next\r\n1. `git clone git@github.com:Vadorequest/serverless-with-next.git`\r\n1. `nvm use` or use node 6.10.3\r\n1. `npm i`\r\n1. `npm run build:staging` => Generates a .next folder, you can check files have absolute path here\r\n1. `serverless deploy -v --package .serverless` => Deploy to AWS, requires serverless cli, and an AWS account\r\n\r\n## Your Environment\r\n<!--- Include as many relevant details about the environment you experienced the bug in -->\r\n| Tech    | Version |\r\n|---------|---------|\r\n| next    |    5     |\r\n| node    |     6.10.3    |\r\n| OS      |    MacOS X     |\r\n"},"comment":{"url":"https://api.github.com/repos/zeit/next.js/issues/comments/368788381","html_url":"https://github.com/zeit/next.js/issues/3903#issuecomment-368788381","issue_url":"https://api.github.com/repos/zeit/next.js/issues/3903","id":368788381,"user":{"login":"timneutkens","id":6324199,"avatar_url":"https://avatars2.githubusercontent.com/u/6324199?v=4","gravatar_id":"","url":"https://api.github.com/users/timneutkens","html_url":"https://github.com/timneutkens","followers_url":"https://api.github.com/users/timneutkens/followers","following_url":"https://api.github.com/users/timneutkens/following{/other_user}","gists_url":"https://api.github.com/users/timneutkens/gists{/gist_id}","starred_url":"https://api.github.com/users/timneutkens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timneutkens/subscriptions","organizations_url":"https://api.github.com/users/timneutkens/orgs","repos_url":"https://api.github.com/users/timneutkens/repos","events_url":"https://api.github.com/users/timneutkens/events{/privacy}","received_events_url":"https://api.github.com/users/timneutkens/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T08:41:03Z","updated_at":"2018-02-27T08:41:03Z","author_association":"OWNER","body":"Upgrade to next@canary. It’s been fixed already."}}
{"actor":{"display_login":"timneutkens"}}