start-server-and-test
start-server-and-test copied to clipboard
Node 17 support
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:openshould start the app server and open Cypress - actual behavior: running this ^ starts the server but doesn't open Cypress, hence it eventually times out
bump
It's been awhile since we saw an update for this repository so it might take awhile.
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.
Node 16 should work. 17+ does not.
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
This might be related to this issue (of the underlying
wait-onlib), and the proposed solution/fallback (replacelocalhostby 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).
This might be related to this issue (of the underlying
wait-onlib), and the proposed solution/fallback (replacelocalhostby local IP) might work for people seeing this problem here: jeffbski/wait-on#109 (comment)
It worked for me with 127.0.0.1
Can confirm it does not work for 18 lts either.
@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.
Yes I will look into this
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.
In my project only Mac users have issues, not Linux users.
:tada: This issue has been resolved in version 1.15.5 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@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
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.
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.jsonand make sure that all the127.0.0.1are replaced bylocalhost - 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.
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: @.***>
Sure. How do I turn on verbose logs?
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: @.***>
@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.