{"record":{"id":"9d58eb7a34b38918","repo":"avajs/ava","slug":"this-version-of-ava-pkg-version-does-not-supp","errorCode":null,"errorMessage":"This version of AVA (${pkg.version}) does not support any of the desired shared worker protocols: ${supportedProtocols.join(',')}","messagePattern":"This version of AVA \\((.+?)\\) does not support any of the desired shared worker protocols: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/worker/plugin.js","lineNumber":99,"sourceCode":"\t\t\tyield * receiveMessages();\n\t\t},\n\t};\n}\n\nexport function registerSharedWorker({\n\tfilename,\n\tinitialData,\n\tsupportedProtocols,\n\tteardown,\n}) {\n\tconst options_ = getOptions();\n\n\tif (!options_.workerThreads) {\n\t\tthrow new Error('Shared workers can be used only when worker threads are enabled');\n\t}\n\n\tif (!supportedProtocols.includes('ava-4')) {\n\t\tthrow new Error(`This version of AVA (${pkg.version}) does not support any of the desired shared worker protocols: ${supportedProtocols.join(',')}`);\n\t}\n\n\tfilename = String(filename); // Allow URL instances.\n\n\tlet worker = workers.get(filename);\n\tif (worker === undefined) {\n\t\tworker = createSharedWorker(filename, initialData, async () => {\n\t\t\t// Run possibly asynchronous teardown functions serially, in reverse\n\t\t\t// order. Any error will crash the worker.\n\t\t\tconst teardownFns = workerTeardownFns.get(worker);\n\t\t\tif (teardownFns !== undefined) {\n\t\t\t\tfor await (const fn of [...teardownFns].toReversed()) {\n\t\t\t\t\tawait fn();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tworkers.set(filename, worker);\n\t}","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/worker/plugin.js#L81-L117","documentation":"registerSharedWorker negotiates a protocol between the test file and the shared worker. This AVA version only implements the 'ava-4' protocol (lib/worker/plugin.js:98-100); if the caller's supportedProtocols array does not include 'ava-4', AVA throws this Error listing the protocols the caller offered. It means the shared worker (or the plugin wrapper around it) was written for an incompatible AVA protocol generation.","triggerScenarios":"Calling t.registerSharedWorker({ supportedProtocols: [...], ... }) where the array contains anything other than 'ava-4' — e.g. ['ava-3'], ['shared-worker-1'], or a custom protocol name — inside a test file.","commonSituations":"Using a shared worker package built for a different AVA major version, upgrading/downgrading AVA while keeping an old shared worker, hand-writing supportedProtocols with a guessed protocol name, or a library emitting version-specific protocols like ['ava-5'] that this AVA build does not speak.","solutions":["Add 'ava-4' to the supportedProtocols array passed to t.registerSharedWorker().","Upgrade the shared worker package to a version compatible with your AVA major version, or align AVA's version with the protocol the worker supports.","Check pkg.version of the installed AVA and the documented protocol list; only 'ava-4' is accepted by this build."],"exampleFix":"// before\nt.registerSharedWorker({\n  filename: new URL('./shared-worker.js', import.meta.url),\n  supportedProtocols: ['ava-3'],\n});\n\n// after\nt.registerSharedWorker({\n  filename: new URL('./shared-worker.js', import.meta.url),\n  supportedProtocols: ['ava-4'],\n});","handlingStrategy":"validation","validationCode":"const SUPPORTED_BY_AVA = ['ava-4'];\nif (!supportedProtocols.includes('ava-4')) {\n  throw new Error(`Shared worker requires AVA protocol 'ava-4'; offered: ${supportedProtocols.join(',')}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include 'ava-4' in supportedProtocols when using this AVA version.","Keep shared worker packages in sync with your AVA major version during upgrades.","Check the AVA changelog when bumping major versions for protocol changes."],"tags":["ava","shared-worker","protocol-version","compatibility"],"backgroundTag":"shared-worker-protocol-unsupported","analyzedSha":"bbfd946322fdeca2b547a691d947fb4e18c0c67f","analyzedAt":"2026-09-02T01:24:43.834Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}