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

Error: listen EADDRINUSE: address already in use :::3000 #2

Closed
cliffordfajardo opened this issue Dec 24, 2022 · 3 comments
Closed

Error: listen EADDRINUSE: address already in use :::3000 #2

cliffordfajardo opened this issue Dec 24, 2022 · 3 comments

Comments

@cliffordfajardo
Copy link
Collaborator

cliffordfajardo commented Dec 24, 2022

Describe the bug

When attempting to setup remix-kit on a remix express template following the getting started guide, I get the following message when running npm run dev

RemixKit 0.1.0                                                                         22:12:00
Remix 1.9.0                                                                            22:12:00
React 18.2.0                                                                           22:12:00
                                                                                       22:12:00
  > Local:    http://localhost:3000/                                                   22:12:00
  > Network:  http://192.168.1.65:3000/
  > Network:  http://[2600:1700:7274:8990:1c8c:1998:2c3:deda]:3000/
  > Network:  http://[2600:1700:7274:8990::16]:3000/
  > Network:  http://[2600:1700:7274:8990:c1f5:a550:76ab:5524]:3000/
  > Network:  http://[2600:1700:7274:8990:d9c5:e776:d564:418b]:3000/
  > Network:  http://[2600:1700:7274:8990:ec99:3d87:7099:3b45]:3000/

ℹ Cleaning up generated files and caches...                                            22:12:00
✔ Dev server ready in 640.887ms                                                        22:12:01

ℹ Starting Remix server... node ./server.js                                            22:12:01

Express server starting...                                                             22:12:01
Error: listen EADDRINUSE: address already in use :::3000                               22:12:01
    at Server.setupListenHandle [as _listen2] (node:net:1485:16)
    at listenInCluster (node:net:1533:12)
    at Server.listen (node:net:1621:7)
    at Function.listen (/Users/cliffordfajardo/repos/remix-kit-example-app/node_modules/express/lib/application.js:635:24)
    at Object.<anonymous> (/Users/cliffordfajardo/repos/remix-kit-example-app/server.js:40:5)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

Reproduction

https://github.com/cliffordfajardo/remix_kit_repro1

Steps to reproduce

1.Start a new remix express project

$ npx create-remix@latest
? Where would you like to create your app? ./my_remix-kit-example
What type of app do you want to create? (Use arrow keys)
❯ Just the basics
A pre-configured stack ready for production
? Where do you want to deploy? Choose Remix App Server if you're unsure; it's easy to change deployment targets. Express
Server
? TypeScript or JavaScript? TypeScript
? Do you want me to run `npm install`? (Y/n) Y
.
.
.
  1. Install remix kit dependencies:
npm i @remix-kit/vite @remix-kit/react @remix-kit/cli
  1. Start server:
yarn run dev

System Info

System:
    OS: macOS 13.0.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 106.28 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.0 - ~/.volta/tools/image/node/18.12.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 8.19.2 - ~/.volta/tools/image/node/18.12.0/bin/npm
  Browsers:
    Chrome: 108.0.5359.124
    Safari: 16.1
  npmPackages:
    @remix-kit/cli: ^0.1.0 => 0.1.0 
    @remix-kit/react: ^0.1.0 => 0.1.0 
    @remix-kit/vite: ^0.1.0 => 0.1.0 
    @remix-run/dev: ^1.9.0 => 1.9.0 
    @remix-run/eslint-config: ^1.9.0 => 1.9.0 
    @remix-run/express: ^1.9.0 => 1.9.0 
    @remix-run/node: ^1.9.0 => 1.9.0 
    @remix-run/react: ^1.9.0 => 1.9.0 


### Used Package Manager

npm

### Validations

- [X] Read the [Contributing Guidelines](https://github.com/jrestall/remix-kit/blob/main/CONTRIBUTING.md).
- [X] Check that there isn't [already an issue](https://github.com/jrestall/remix-kit/issues) that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a RemixKit issue and not a Remix specific issue. For example, if it's a Remix related bug, it should likely be reported to [remix](https://github.com/remix-run/remix) instead.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/jrestall/remix-kit/discussions).
@jrestall
Copy link
Owner

Thanks for the report @cliffordfajardo! As a quick fix you can either change the express template to run on a different port by changing const port = process.env.PORT || 3000; in the server.js or you can pass --port to remix-kit dev e.g. remix-kit dev --port 3005 which will force the dev server to port 3005.

I'll work on changing the default port for the dev server to avoid this conflict though.

@jrestall
Copy link
Owner

jrestall commented Dec 24, 2022

I've pushed a new release (0.1.2) that should hopefully fix this issue by defaulting the dev server port to 3005.

@cliffordfajardo
Copy link
Collaborator Author

Going to close this as 0.1.2 solved my issue

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

No branches or pull requests

2 participants