Skip to content
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

Address in use error when embedding keystone-next in Next.js #6687

Closed
ericgla opened this issue Sep 30, 2021 · 1 comment
Closed

Address in use error when embedding keystone-next in Next.js #6687

ericgla opened this issue Sep 30, 2021 · 1 comment

Comments

@ericgla
Copy link

ericgla commented Sep 30, 2021

Bug report

I followed this example walkthrough from the KeystoneJS website, and am getting the following error when next.js attempts to start keystone using yarn dev:

✨ Starting Keystone
Error: listen EADDRINUSE: address already in use :::8000
    at Server.setupListenHandle [as _listen2] (net.js:1318:16)
    at listenInCluster (net.js:1366:12)
    at Server.listen (net.js:1452:7)
    at Function.listen (C:\Users\eric\Projects\tmp\sip-keystone\node_modules\express\lib\application.js:618:24)
    at dev (C:\Users\eric\Projects\tmp\sip-keystone\node_modules\@keystone-next\keystone\scripts\dist\keystone.cjs.dev.js:396:22)
    at cli (C:\Users\eric\Projects\tmp\sip-keystone\node_modules\@keystone-next\keystone\scripts\dist\keystone.cjs.dev.js:697:12)
    at Object.<anonymous> (C:\Users\eric\Projects\tmp\sip-keystone\node_modules\@keystone-next\keystone\scripts\dist\keystone.cjs.dev.js:707:1)    
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)

Looking at the source for next.ts, I see this comment on line 30:

// for some reason things blow up with EADDRINUSE if the dev call happens synchronously here
// so we wait a sec and then do it

I was able to get nextjs to start without the address in use error only after changing the setTimeout value to 10000 (10 seconds)

System information

  • OS: Windows 11
  • Browser: Chrome Version 94.0.4606.61 (Official Build) (64-bit)
  • nodejs: v14.17.0
@borisno2
Copy link
Member

Closing as new Keystone in Next.js is available, see https://keystonejs.com/blog/nextjs-keystone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants