Playwright error
Error: Timed out waiting 60000ms from config.webServer.
"Error: Timed out waiting 60000ms from config.webServer." means Playwright started your webServer command, then polled the url for the whole timeout, 60000 ms by default, and never got a status it counts as ready: 2xx, 3xx, or 400 to 403. The usual causes are a server on another port than the url in the config, a page that answers 500 in the CI job, or a very slow start. A command that exits gives a different message, "Process from config.webServer was not able to start." Run with DEBUG=pw:webserver, make url match the port the server prints, set stdout to pipe to read its output, and raise timeout only for a slow start. Reproduced with @playwright/test 1.64.1 on 2026-10-31.
What is Playwright waiting for, and why does it work on my machine?
The webServer plugin (packages/playwright/src/plugins/webServerPlugin.ts) starts the command, then sends a GET to the url until the status is at least 200 and below 404 (packages/utils/network.ts). If you set port instead of url, it waits until that port accepts connections. The timeout is 60000 ms unless you set one, and the error prints the value it used. On your machine a dev server may already be running on the right port; in CI the command starts it, and any difference in port, host or variables shows up. The framework defaults are in each docs page: Next.js uses port 3000 for next dev and next start, Vite uses 5173 for the dev server and 4173 for vite preview, and Vite tries the next free port instead of failing unless strictPort is true.
In our run the server listened on 4000 and the config waited on http://localhost:3000. The debug output shows the failed check, and the server line shows the port it really took.
$ DEBUG=pw:webserver npx playwright test
pw:webserver HTTP GET: http://localhost:3000/
pw:webserver Error while checking if http://localhost:3000/ is available: connect ECONNREFUSED ::1:3000
connect ECONNREFUSED 127.0.0.1:3000
pw:webserver Starting WebServer process node srv/server.mjs...
[WebServer] listening on 4000
Error: Timed out waiting 4000ms from config.webServer.The server is up, but the page answers 500 in CI
A server on the right port still times out when the url answers outside the ready range. In our run a server answered 500 on / and the run ended with the same Timed out message, while a server answering 401 passed, because the Playwright docs list 401 as ready. The usual reason in CI is that a variable your app reads on the home page exists on your machine and not in the job, so the page throws. Pass the variables through the env of the step that runs the tests, or through webServer.env, and check which variables the code reads. Pointing url at a route that answers 200 without needing data also avoids the problem.
What if it says "was not able to start" or "is already used"?
Those are two other messages from the same file. "Process from config.webServer was not able to start. Exit code: 1" means the command ended before the url answered; we got it with a command that exits with code 1. A command that needs a build first, such as next start, is a candidate, since the Next.js docs say the app should be compiled with next build first. "http://localhost:3000 is already used, make sure that nothing is running on the port/url or set reuseExistingServer:true in config.webServer." means something already answers on the url and reuseExistingServer is not true.
Checklist
How to fix it, then check the fix
- 01Run the webServer command by hand in a terminal and read which URL it prints. Compare it with url in playwright.config.ts: scheme, host and port.
- 02Match url to that address, and pipe the server output so the CI log shows why it fails. The docs default stdout to ignore and stderr to pipe, and show a longer timeout for a slow server:
webServer: { command: 'npm run start', url: 'http://localhost:3000', stdout: 'pipe', timeout: 120 * 1000, }, - 03Run the tests with debug logging and read the last status line the check got:
DEBUG=pw:webserver npx playwright test - 04List the variables the code reads, and set each one in the CI step that runs the tests:
grep -rnE "process\.env\.[A-Z_]+" --exclude-dir=node_modules --exclude-dir=.next . - 05If the command is next start, run next build before it in the job, or use a command that does both, and allow for the longer start with timeout.
- 06Run the job again. The error is gone when the first test starts and the log no longer ends with Timed out waiting.
Related
Related guides
Sources
Official docs behind this checklist
- Playwright, Web server (url, port, timeout, stdout, reuseExistingServer)
- Playwright, Continuous Integration
- playwright, plugins/webServerPlugin.ts (the three messages, the 60 second default)
- playwright, utils/network.ts (isURLAvailable, status from 200 to below 404)
- Next.js, next CLI (default port 3000, next start needs next build)
- Vite, Server options (port 5173, strictPort)
- Vite, Preview options (port 4173)
Browse all launch guides · Read resources · How to make and check your next change
FAQ
FAQ for builders before launch
Should I just raise the timeout?
Only for a server that is slow but on the right url. The Playwright docs say webservers can take longer to boot and show a timeout of 120 * 1000. In our mismatch run the server was up on port 4000 the whole time and the check on 3000 never succeeded, so a longer wait would only have taken longer to fail.
Does a 401 or 403 count as ready?
Yes. The docs say the url must return a 2xx, 3xx, 400, 401, 402 or 403 status code, and a server answering 401 on / passed in our run. A 404 does not count, except that a 404 on the root path is retried once on /index.html.
What is the difference between url and port?
The docs mark port as deprecated and tell you to use url. With port, Playwright waits until the port accepts connections. With url, it waits for a ready HTTP status.