New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timed out waiting for a url #375
Comments
I've got the same issue. Switching back to v2.0.1 makes it working again. |
I switched back to v2.0.1. It also has this problem |
I can do this. server: {
host: '0.0.0.0'
},
preview: {
host: '0.0.0.0',
port: 4173
} |
I have the same issue (tested on Linux). Version 2.0.2 works, version 2.0.3 does not. The only change that happened in this version was: I'll check if this is a known issue with wait-on. |
I couldn't tie this problem to either the wait-on or axios version change. I think it's related to how start-server-and-test uses wait-on, although I'm not sure. Here's some details. Test 1: Testing wait-on alone in an empty project using a test script:
My test script was the following. I tried to approximate as much as I could to what start-server-and-test does: const waitOn = require('wait-on');
const url = 'http://127.0.0.1:5173';
// Options for wait-on
const options = {
resources: [url],
delay: 1000, // initial delay in ms, default 0
timeout: 10000, // timeout in ms, default Infinity
interval: 2000,
window: 1000,
log: true, // Enables logging
verbose: true,
headers: {
Accept: 'text/html, application/json, text/plain, */*',
},
validateStatus: (status) => (status >= 200 && status < 300) || status === 304,
};
// Wait for the resource to become available
waitOn(options, (err) => {
if (err) {
console.log('error waiting for url', url);
console.log(err.message);
return;
}
console.log('waitOn finished successfully');
}); Test 2: However, when I used start-server-and-test, I had different results in a freshly-created Vite project (created with command
|
Environment:
start-server-and-test:2.0.3
node: 20.9.0
pnpm: 8.9.0
npm: 10.1.0
os: ubuntu 20.04
In package.json,
"test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e --browser firefox'"
Run pnpm test:e2e,show
When stopping
vite preview
, visit http://localhost:4173 successfully.Use
npx cypress run --e2e --browser firefox
okThe text was updated successfully, but these errors were encountered: