-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploying next.js app fails with UnhandledPromiseRejectionWarning #175
Comments
The error message |
Yep. Make sure you alter the filesystem in the |
The build step seems to run fine ( Looks like it has to do with the start script: "scripts": {
"dev": "next",
"build": "next build",
"start": "node index.js",
"deploy": "now -e NODE_ENV=production",
"lint": "eslint ."
} When I change this back to So there seems to be a difference on how the custom server works my local machine (OS X 10.12, Node 7.0.0) and on now.sh. My const { createServer } = require('http')
const { parse } = require('url')
const next = require('next')
const pathMatch = require('path-match')
const app = next({ dev: true })
const handle = app.getRequestHandler()
const route = pathMatch()
const match = route('/wine/:id')
app.prepare().then(() => {
createServer((req, res) => {
const { pathname } = parse(req.url)
const params = match(pathname)
if (params === false) {
handle(req, res)
return
}
app.render(req, res, '/wine', params)
}).listen(3000, (err) => {
if (err) throw err
console.log('> Ready on http://localhost:3000')
})
}) Is this something I could work around by "altering the filesystem", @rauchg? Could you give me a hint there? |
Argh, it works fine if I remove /cc @nkzawa |
What do you mean by "alter the filesystem" in the context of zeit now? I'm having the same error:
|
To write data to the disk (expect temporary files to Try running the |
It looks like it's crashing when running Also this message might be part of the problem.
Maybe it's rebuilding because that file is missing. I'll probably need to figure out how to split that file first. |
I ran into the same problem using eg:
(as seen in the example https://github.com/zeit/next.js/blob/canary/examples/with-dotenv/.babelrc) The issue was caused by using
in the /index.js file since it's not transpiled by babel. Switching it to:
works for Now. |
I was having the same issue with my
I fixed this prepending
|
I was getting a BUILD_ERROR from Error: EACCES: permission denied, rmdir '/home/nowuser/src/.next' The above suggestion of adding
to the scripts in the package json fixed the issue for me |
* Add check for writeable directory Followup of vercel/vercel#175 * Add link to docs
I got into this issue by using Serverless and compiling my code in development mode, which automatically enabled HMR, which tried to write stuff on the disk, which failed because
|
Please I am building a mock authentication project and I am having the same problem
npm ERR! A complete log of this run can be found in: my server.js looks like this: `const next = require('next'); const dev = process.env.NODE_ENV !== 'production'; const authenticate = async(email, password)=> { return data.find(user=> { app.prepare().then(()=>{
})` my package.json { it runs fine in development ofcourse but I cant deploy keeps giving me that nasty error; |
* Fix broken error link * Added legacy mode error Standard "Next.js" for all citations of Next. Add "Legacy Mode" error. * Update no serverless pages built doc * Update doc on now/next legacy mode * Add link after the error message
* Add check for writeable directory Followup of vercel/vercel#175 * Add link to docs
I'm trying to deploy the current GitHub version of next.js. In order to work around the fact the the
dist
folder is missing on GitHub, I have forked the repo and added these files: https://github.com/backflip/next.js/tree/releaseHowever,
npm start
fails with a(node:275) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: EACCES: permission denied, rmdir '/home/nowuser/src/.next'
.Could this be related to the warnings/errors further above regarding
node-pre-gyp
(which is connected to the recent addition ofchokidar
to next.js)?The text was updated successfully, but these errors were encountered: