start-server-and-test icon indicating copy to clipboard operation
start-server-and-test copied to clipboard

Node 17 support

Open rtrembecky opened this issue 2 years ago • 5 comments

Bug report

Hi, as mentioned in #328 by several people, it seems the package doesn't support node 17+ or at least is unable to execute a command after the server is up and ready. I created a new issue in case it is a different topic than #328 (probably is).

  • version: 1.14.0 (latest)
  • platform: macOS Monterey 12.2.1
  • expected behavior: running start-server-and-test start 8000 cy:open should start the app server and open Cypress
  • actual behavior: running this ^ starts the server but doesn't open Cypress, hence it eventually times out

rtrembecky avatar May 11 '22 22:05 rtrembecky

bump

itsyoboieltr avatar Jun 09 '22 11:06 itsyoboieltr

It's been awhile since we saw an update for this repository so it might take awhile.

rodoabad avatar Jul 19 '22 03:07 rodoabad

I'm seeing the same issue with node 16, but I'm not with node 14. but instead of Cypress, I see it with serverless-offline

edit: Ok false alarm. The problem was not this package. It turns out the base url for serverless-offline changed, so the stage had to be suffixed. The previous URL now gave 404, causing to never be able to reach the target url. Using the DEBUG flag (See the readme) helped me to figure it out.

gndelia avatar Aug 16 '22 21:08 gndelia

Node 16 should work. 17+ does not.

rodoabad avatar Aug 21 '22 16:08 rodoabad

This might be related to this issue (of the underlying wait-on lib), and the proposed solution/fallback (replace localhost by local IP) might work for people seeing this problem here: https://github.com/jeffbski/wait-on/issues/109#issue-1071849300

CamilleDrapier avatar Sep 14 '22 02:09 CamilleDrapier

This might be related to this issue (of the underlying wait-on lib), and the proposed solution/fallback (replace localhost by local IP) might work for people seeing this problem here: jeffbski/wait-on#109 (comment)

What we did was actually the opposite (people can either do it one way or another).

We had a server that was starting at 0.0.0.0:8080 and wait-on couldn't wait for it since wait-on was waiting for localhost:8080. What we did instead is, change 0.0.0.0:8080 to localhost:8080 and it worked on us. We didn't have to change our npm script to include http://localhost:8080 for start-server-and-start it still stay at 8080 (shorthand).

rodoabad avatar Oct 31 '22 21:10 rodoabad

This might be related to this issue (of the underlying wait-on lib), and the proposed solution/fallback (replace localhost by local IP) might work for people seeing this problem here: jeffbski/wait-on#109 (comment)

It worked for me with 127.0.0.1

spectronp avatar Nov 09 '22 13:11 spectronp

Can confirm it does not work for 18 lts either.

actuallymentor avatar Jan 11 '23 13:01 actuallymentor

@bahmutov is there any plan to fix this issues? Many tools are now using Node 18 as the default version since we are only 6 months away from having no support on Node 16.

nbouvrette avatar Feb 18 '23 18:02 nbouvrette

Yes I will look into this

bahmutov avatar Feb 19 '23 13:02 bahmutov

Can someone provide a reproducible example? I have tested this tool using Node v18 in https://github.com/bahmutov/start-server-and-test/pull/354 and don't see any problems.

bahmutov avatar Feb 22 '23 18:02 bahmutov

In my project only Mac users have issues, not Linux users.

cbookg avatar Feb 22 '23 18:02 cbookg

:tada: This issue has been resolved in version 1.15.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Feb 26 '23 19:02 github-actions[bot]

@bahmutov I just tested with version 2 and I got the issue happening again. I suspect there is another issue to fix.

It's only happening on this script:

    "e2e-build-headless-base-path": "cross-env CYPRESS_isProd=true BASE_PATH=/some-path CYPRESS_basePath=/some-path start-server-and-test start-example-build http://localhost:3000/some-path cypress-headless",

This one seems to work fine:

    "e2e-build-headless": "cross-env CYPRESS_isProd=true start-server-and-test start-example-build http://localhost:3000 cypress-headless",

Feel free to try to reproduce cloning this repo: https://github.com/Avansai/next-multilingual

Can run npm run test which will run all the different commands, and if you replace 127.0.0.1 when using Node 18, it will freeze at the 3rd command.

nbouvrette avatar Feb 27 '23 20:02 nbouvrette

@nbouvrette

Could you say which OS you are testing on? localhost can work differently depending on this. I didn't find any workflows on https://github.com/Avansai/next-multilingual (.github/workflows) to give me a hint.

MikeMcC399 avatar Feb 27 '23 20:02 MikeMcC399

I'm on macOS 13.2.1

Regarding next-multilingual here would be step-by-step reproductions:

  1. Clone https://github.com/Avansai/next-multilingual
  2. run npm run install
  3. run npm run build
  4. Open package.json and make sure that all the 127.0.0.1 are replaced by localhost
  5. run npm run test

If you check the script for npm run test you will see that there are 4 different subscripts being run with different start-server-and-test steps. The 3rd step will hang, and when I press ctrl-c it sort of resumes but go back into the same stuck step. Those tests can take a few minutes to run before it hangs (there are a lot of tests).

Of course, you need to be on Node >= v18+. It didn't do this when I was on Node 16.

nbouvrette avatar Feb 28 '23 03:02 nbouvrette

Could you please open a new issue and include debugging verbose logs?Sent from my iPhoneOn Feb 27, 2023, at 22:33, Nicolas Bouvrette @.***> wrote: I'm on macOS 13.2.1 Regarding next-multilingual here would be step-by-step reproductions:

Clone https://github.com/Avansai/next-multilingual run npm run install run npm run build Open package.json and make sure that all the 127.0.0.1 are replaced by localhost run npm run test

If you check the script for npm run test you will see that there are 4 different subscripts being run with different start-server-and-test steps. The 3rd step will hang, and when I press ctrl-c it sort of resumes but go back into the same stuck step.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

bahmutov avatar Feb 28 '23 03:02 bahmutov

Sure. How do I turn on verbose logs?

nbouvrette avatar Feb 28 '23 03:02 nbouvrette

Check out the debugging section of the readme. Just need to set DEBUG env variable when running with the name of the module Sent from my iPhoneOn Feb 27, 2023, at 22:59, Nicolas Bouvrette @.***> wrote: Sure. How do I turn on verbose logs?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

bahmutov avatar Feb 28 '23 04:02 bahmutov

@nbouvrette

I'm on macOS 13.2.1

I was hoping to be able to try this out, however on https://github.com/actions/runner-images macos-latest is equivalent to macos-12 so your version is not yet available. I'll be interested if you open a new issue and provide debug logs anyway.

MikeMcC399 avatar Feb 28 '23 07:02 MikeMcC399