Puppeteer: Extension ID and version are required
An extension object cannot be created because the browser's reported extension metadata lacks its ID or version.
An extension object cannot be created because the browser’s reported extension metadata lacks its ID or version.
Error message
Extension ID and version are required
How this error happens
Puppeteer’s extension object requires an ID and extension version in the browser’s reported metadata. If either is missing, listing or creating that object fails its constructor check.
The failing snippet uses an existing extension-enabled browser. The correction uses an imported puppeteer instance and a valid extension directory.
const extensions = await browser.extensions();
console.log(extensions);
How to fix
Load a valid unpacked extension through the public launcher and let the browser provide its identity and metadata.
const browser = await puppeteer.launch({
browser: "chrome",
pipe: true,
enableExtensions: [
"/absolute/path/unpacked-extension",
],
});
const extensions = await browser.extensions();
console.log(extensions);
Things to keep in mind
The first call only fails if the browser reports incomplete extension metadata. Check the extension’s manifest and loading errors. Do not construct Puppeteer’s internal Extension class with invented IDs.