frctl / fractal

A tool to help you build and document website component libraries and design systems.
https://fractal.build
MIT License
2.11k stars 171 forks source link

Can’t run more than one development server #1043

Open supermueller opened 3 years ago

supermueller commented 3 years ago

After updating Fractal to v1.5.8 it isn’t possible anymore to run more than one development server (Error: listen EADDRINUSE: address already in use :::3000). Before the update starting a second server automatically increments the port.

Steps to reproduce the issue

  1. Start a development server using fractal start.
  2. In a different project start a development server using fractal start.
  3. You will get an error message: Error: listen EADDRINUSE: address already in use :::3000

Reproduces how often:

This will happen every time; but if you use fractal start --sync the second server starts with an automatically incremented port.

Context

LeBenLeBen commented 3 years ago

Relates to #713

mihkeleidast commented 3 years ago

Not sure it relates to #713 - that change was released a while ago. What version of Fractal did you update from?

In this repository, if I try to start two of the projects in the examples directory without sync, the first one starts on port 3000 and the second on port 3001. So I'm afraid I can't reproduce this right now without more info.

Looking at sindresorhus/get-port#31, we already specify host so it would always look at IPv4 ports. Not sure what else we can do here.

supermueller commented 3 years ago

@mihkeleidast If have updated fractal from version 1.5.0. If I try to setup fractal using the handlebars example (https://github.com/frctl/fractal/tree/main/examples/handlebars), I get en error when running npm install, so I can’t test it with a „clean“ project.

mihkeleidast commented 3 years ago

What error? The handlebars example is not meant to be installed standalone, as it depends on private packages only existing in this repository - but you should be able to do:

  1. npm ci
  2. npm run bootstrap
  3. Then go to the handlebars/nunjucks etc directory to start Fractal.
supermueller commented 3 years ago

What error? The handlebars example is not meant to be installed standalone, as it depends on private packages only existing in this repository - but you should be able to do:

  1. npm ci
  2. npm run bootstrap
  3. Then go to the handlebars/nunjucks etc directory to start Fractal.

Thanks for the help with this.

I have tested to start two Fractal development servers as you described above and still got the error message that the address is already in use.

mihkeleidast commented 3 years ago

Update: https://github.com/sindresorhus/get-port/pull/56 got merged today, but the module is now also full ESM, which makes it hard to update for us :(