vitest-dev/vitest · error · Error
Method "getByPlaceholder" is not supported by the "${provide
Error message
Method "getByPlaceholder" is not supported by the "${provider}" provider. What it means
page.getByPlaceholder is a throwing stub (packages/browser/src/client/tester/context.ts:451-452). Placeholder queries live on Locator instances (getElementLocatorSelectors wires locator.getByPlaceholder at context.ts:516). The page-level call throws.
Source
Thrown at packages/browser/src/client/tester/context.ts:452
}],
error,
)
})
},
getByRole() {
throw new Error(`Method "getByRole" is not supported by the "${provider}" provider.`)
},
getByLabelText() {
throw new Error(`Method "getByLabelText" is not supported by the "${provider}" provider.`)
},
getByTestId() {
throw new Error(`Method "getByTestId" is not supported by the "${provider}" provider.`)
},
getByAltText() {
throw new Error(`Method "getByAltText" is not supported by the "${provider}" provider.`)
},
getByPlaceholder() {
throw new Error(`Method "getByPlaceholder" is not supported by the "${provider}" provider.`)
},
getByText() {
throw new Error(`Method "getByText" is not supported by the "${provider}" provider.`)
},
getByTitle() {
throw new Error(`Method "getByTitle" is not supported by the "${provider}" provider.`)
},
elementLocator() {
throw new Error(`Method "elementLocator" is not supported by the "${provider}" provider.`)
},
frameLocator() {
throw new Error(`Method "frameLocator" is not supported by the "${provider}" provider.`)
},
extend(methods) {
for (const key in methods) {
(page as any)[key] = (methods as any)[key].bind(page)
}
return pageView on GitHub (pinned to d568f8ce37)
Solutions
- Use a Locator: page.elementLocator(document.body).getByPlaceholder('Search...').
- Register page.getByPlaceholder via browser.locators.extend(...) if needed.
Example fix
// before
const input = page.getByPlaceholder('Search')
// after
const input = page.elementLocator(document.body).getByPlaceholder('Search') Defensive patterns
Strategy: type-guard
Validate before calling
const root = page.elementLocator(document.body)
const input = root.getByPlaceholder('Search...') Prevention
- Use page.elementLocator(...).getByPlaceholder rather than the page-level stub.
When it happens
Trigger: Calling page.getByPlaceholder('Search...') directly on the page object.
Common situations: Form tests; copying testing-library getByPlaceholder usage onto page.
Related errors
- Method "getByRole" is not supported by the "${provider}" pro
- Method "getByLabelText" is not supported by the "${provider}
- Method "getByTestId" is not supported by the "${provider}" p
- Method "getByAltText" is not supported by the "${provider}"
- Method "getByText" is not supported by the "${provider}" pro
AI-assisted analysis of vitest-dev/vitest@d568f8ce37 (2026-08-03).
Data as JSON: /data/errors/12e5a73c6036e5ca.json.
Report an issue: GitHub.