This is a bit of a weird one, but I'm pretty sure I've narrowed down the cause.
Symptoms
Playwright tests running on a vite preview server fail to start. Playwright is unable to detect that that the server is running.
Probable cause
Playwright sends a GET request with an Accepts: */* header to the configured URL to determine if the server is running. This plugin overwrites the default headers accepted for rewrites by the connect-history-api-fallback module here:
|
htmlAcceptHeaders: ['text/html', 'application/xhtml+xml'], |
Since
*/* is no longer a valid header for a rewrite, Playwright's requests are never handled, and it can never tell that the server is running.
Possible solution
Add */* to the accepted headers, or reinstate the default ones. If that would break things, perhaps make them configurable somehow. I'm not sure what the context was behind changing the defaults initially so I'm not sure what the best solution is in this scenario.
This is a bit of a weird one, but I'm pretty sure I've narrowed down the cause.
Symptoms
Playwright tests running on a
vite previewserver fail to start. Playwright is unable to detect that that the server is running.Probable cause
Playwright sends a GET request with an
Accepts: */*header to the configured URL to determine if the server is running. This plugin overwrites the default headers accepted for rewrites by theconnect-history-api-fallbackmodule here:vite-plugin-virtual-mpa/src/plugin.ts
Line 110 in 5aed389
*/*is no longer a valid header for a rewrite, Playwright's requests are never handled, and it can never tell that the server is running.Possible solution
Add
*/*to the accepted headers, or reinstate the default ones. If that would break things, perhaps make them configurable somehow. I'm not sure what the context was behind changing the defaults initially so I'm not sure what the best solution is in this scenario.