{"id":41741,"library":"plugin-javascript","title":"plugin-javascript","description":"A plugin for sitespeed.io that identifies and logs JavaScript errors during web performance testing. Current stable version is 2026.6.0, released as part of sitespeed.io's yearly release cycle. Integrates seamlessly with sitespeed.io to capture JS errors from browser sessions and report them. Unlike general error monitoring tools, it is specifically built for sitespeed.io's plugin architecture and complements webperf-core. Requires Node.js >=20.x and sitespeed.io as a peer dependency.","status":"active","version":"2026.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/Webperf-se/plugin-javascript","tags":["javascript","sitespeed.io","js","Javascript","webperf","webperf_core","webperf-core"],"install":[{"cmd":"npm install plugin-javascript","lang":"bash","label":"npm"},{"cmd":"yarn add plugin-javascript","lang":"bash","label":"yarn"},{"cmd":"pnpm add plugin-javascript","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; the plugin only works when loaded by sitespeed.io","package":"sitespeed.io","optional":false}],"imports":[{"note":"Package is ESM-only since v2026; CommonJS require will fail.","wrong":"const pluginJavascript = require('plugin-javascript');","symbol":"default","correct":"import pluginJavascript from 'plugin-javascript'"},{"note":"Named export for TypeScript type usage.","wrong":"import PluginJavascript from 'plugin-javascript'","symbol":"PluginJavascript","correct":"import { PluginJavascript } from 'plugin-javascript'"},{"note":"Function to manually register the plugin if not using auto-detection.","wrong":"import { register } from 'plugin-javascript'","symbol":"registerPlugin","correct":"import { registerPlugin } from 'plugin-javascript'"}],"quickstart":{"code":"import pluginJavascript from 'plugin-javascript';\nimport sitespeedio from 'sitespeed.io';\n\nconst options = {\n  urls: ['https://www.example.com'],\n  plugins: {\n    'plugin-javascript': { enabled: true }\n  }\n};\n\n(async () => {\n  const result = await sitespeedio.run(options);\n  console.log('JS errors found:', result.javascriptErrors);\n})();","lang":"typescript","description":"Shows how to enable and use the plugin with sitespeed.io programmatically, capturing JavaScript errors from a web page."},"warnings":[{"fix":"Upgrade Node.js to version 20.x or higher.","message":"Version 2026.0+ drops support for Node.js <20","severity":"breaking","affected_versions":">=2026.0"},{"fix":"Use import syntax or dynamic import().","message":"ESM-only: CommonJS require() will throw an error","severity":"breaking","affected_versions":">=2026.0"},{"fix":"Change config from { javascript: { ... } } to { 'plugin-javascript': { ... } }.","message":"The plugin configuration key 'javascript' is deprecated; use 'plugin-javascript' instead","severity":"deprecated","affected_versions":">=2025.0"},{"fix":"Ensure sitespeed.io is a peer dependency and loaded first.","message":"Plugin only works when sitespeed.io is installed; cannot be used standalone","severity":"gotcha","affected_versions":"all"},{"fix":"Use a browser configuration that enables JavaScript error reporting.","message":"JavaScript errors are only captured if the browser supports error logging; some headless modes may miss errors","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'20':67 '2026.6.0':22 'architectur':59 'browser':41 'built':54 'captur':37 'complement':61 'core':64,81,84 'current':18 'cycl':31 'depend':74 'error':13,39,48 'general':47 'identifi':9 'integr':32 'javascript':3,12,75,78 'js':38,77 'log':11 'monitor':49 'node.js':66 'part':25 'peer':73 'perform':16 'plugin':2,5,58 'plugin-javascript':1 'releas':23,30 'report':44 'requir':65 'seamless':33 'session':42 'sitespeed.io':7,27,35,56,70,76 'specif':53 'stabl':19 'test':17 'tool':50 'unlik':46 'version':20 'web':15 'webperf':63,79,80,83 'webperf-cor':62,82 'x':68 'year':29","created_at":"2026-06-04T18:53:52.829679+00:00","updated_at":"2026-06-04T18:53:52.829679+00:00","problems":[{"fix":"Run npm install plugin-javascript","cause":"Package not installed or not in node_modules","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'plugin-javascript'"},{"fix":"Change config to use 'plugin-javascript' as the plugin key","cause":"Using deprecated key 'javascript' instead of 'plugin-javascript'","error":"TypeError: config.plugins['plugin-javascript'] is not a valid plugin configuration"},{"fix":"Use import or dynamic import, or downgrade to a version that supports CommonJS","cause":"Using CommonJS require() with ESM-only package","error":"SyntaxError: The requested module 'plugin-javascript' does not provide an export named 'default'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Webperf-se/plugin-javascript#readme","github":"https://github.com/Webperf-se/plugin-javascript","docs":null,"changelog":null,"pypi":null,"npm":"plugin-javascript","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}