What happened?
When running npm init @code-pushup/cli on a Vite + React project, the setup wizard prompts for target URLs for the Axe and Lighthouse plugins with a default of http://localhost:4200.
That port is correct for Angular/Nx, but Vite serves on http://localhost:5173 by default. Accepting the default (pressing Enter) writes the wrong URL into code-pushup.config.js. Web audits then fail unless the user manually changes the port.
Other wizard plugins already auto-detect project settings (ESLint config, tsconfig, package manager, test framework). Axe and Lighthouse do not — they use a hardcoded default:
packages/plugin-axe/src/lib/binding.ts → const DEFAULT_URL = 'http://localhost:4200'
packages/plugin-lighthouse/src/lib/binding.ts → const DEFAULT_URL = 'http://localhost:4200'
What would you expect to happen?
The wizard should detect the likely dev server URL from the project and use it as the default in the Target URL(s) prompt, for example:
- Vite (
vite.config.*, no custom port) → http://localhost:5173
- Vite with
server.port set → http://localhost:<port>
- Angular/Nx →
http://localhost:4200 (or configured port)
- Next.js (
next dev in scripts) → http://localhost:3000
- Unknown → fallback to
4200 with a note that the user should confirm
Optionally, the prompt could show where the suggestion came from, e.g.
Target URL(s) (detected from vite.config.js): http://localhost:5173
What steps did you take?
-
Scaffold a Vite + React app:
npm create vite@latest js-app -- --template react
cd js-app
npm install
git init
-
Run the Code PushUp setup wizard:
npm init @code-pushup/cli
-
Choose:
- Setup mode: Standalone
- Plugins: include Axe and Lighthouse (among others)
- Config format: JavaScript
-
For both Lighthouse and Axe, accept the default Target URL: http://localhost:4200
-
Finish setup — code-pushup.config.js is created with:
lighthousePlugin('http://localhost:4200')
axePlugin('http://localhost:4200', { preset: 'all' })
-
Start the app:
App runs at http://localhost:5173/
-
Run Code PushUp:
-
Result: web audits target :4200 while the app is on :5173 — audits fail or produce no useful results until the URL is fixed manually.
Code PushUp package version
@code-pushup/create-cli@0.126.3
What operation system are you on?
Linux
Node version
v22.22.3
Relevant log output
Wizard output (URL defaults):
Lighthouse
✔ Target URL(s) (comma-separated): http://localhost:4200
Axe
✔ Target URL(s) (comma-separated): http://localhost:4200
Generated config excerpt:
const lhPlugin = lighthousePlugin('http://localhost:4200');
const axe = axePlugin('http://localhost:4200', { preset: 'all' });
Vite dev server (correct port):
VITE v8.0.16 ready in 436 ms
➜ Local: http://localhost:5173/
What happened?
When running
npm init @code-pushup/clion a Vite + React project, the setup wizard prompts for target URLs for the Axe and Lighthouse plugins with a default ofhttp://localhost:4200.That port is correct for Angular/Nx, but Vite serves on
http://localhost:5173by default. Accepting the default (pressing Enter) writes the wrong URL intocode-pushup.config.js. Web audits then fail unless the user manually changes the port.Other wizard plugins already auto-detect project settings (ESLint config,
tsconfig, package manager, test framework). Axe and Lighthouse do not — they use a hardcoded default:packages/plugin-axe/src/lib/binding.ts→const DEFAULT_URL = 'http://localhost:4200'packages/plugin-lighthouse/src/lib/binding.ts→const DEFAULT_URL = 'http://localhost:4200'What would you expect to happen?
The wizard should detect the likely dev server URL from the project and use it as the default in the
Target URL(s)prompt, for example:vite.config.*, no custom port) →http://localhost:5173server.portset →http://localhost:<port>http://localhost:4200(or configured port)next devin scripts) →http://localhost:30004200with a note that the user should confirmOptionally, the prompt could show where the suggestion came from, e.g.
Target URL(s) (detected from vite.config.js): http://localhost:5173What steps did you take?
Scaffold a Vite + React app:
npm create vite@latest js-app -- --template react cd js-app npm install git initRun the Code PushUp setup wizard:
Choose:
For both Lighthouse and Axe, accept the default Target URL:
http://localhost:4200Finish setup —
code-pushup.config.jsis created with:Start the app:
App runs at
http://localhost:5173/Run Code PushUp:
Result: web audits target
:4200while the app is on:5173— audits fail or produce no useful results until the URL is fixed manually.Code PushUp package version
@code-pushup/create-cli@0.126.3
What operation system are you on?
Linux
Node version
v22.22.3
Relevant log output