{"id":"d97baa690e5c999d","repo":"webpack/webpack","slug":"no-deserializer-registered-for-key","errorCode":null,"errorMessage":"No deserializer registered for ${key}","messagePattern":"No deserializer registered for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/serialization/ObjectMiddleware.js","lineNumber":355,"sourceCode":"\t\t\t);\n\t\t}\n\t\tif (config === NOT_SERIALIZABLE) throw NOT_SERIALIZABLE;\n\n\t\treturn /** @type {SerializerConfigWithSerializer} */ (config);\n\t}\n\n\t/**\n\t * Gets deserializer for.\n\t * @param {string} request request\n\t * @param {string} name name\n\t * @returns {ObjectSerializer} serializer\n\t */\n\tstatic getDeserializerFor(request, name) {\n\t\tconst key = `${request}/${name}`;\n\t\tconst serializer = serializerInversed.get(key);\n\n\t\tif (serializer === undefined) {\n\t\t\tthrow new Error(`No deserializer registered for ${key}`);\n\t\t}\n\n\t\treturn serializer;\n\t}\n\n\t/**\n\t * Get deserializer for without error.\n\t * @param {string} request request\n\t * @param {string} name name\n\t * @returns {ObjectSerializer | undefined} serializer\n\t */\n\tstatic _getDeserializerForWithoutError(request, name) {\n\t\tconst key = `${request}/${name}`;\n\t\tconst serializer = serializerInversed.get(key);\n\t\treturn serializer;\n\t}\n\n\t/**","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/webpack/webpack/blob/318421ea8ac81371f5171236a6efb63675576528/lib/serialization/ObjectMiddleware.js#L337-L373","documentation":"getDeserializerFor looks up `serializerInversed` by the key `<request>/<name>` embedded in the cache; if no entry was registered in this process it throws `No deserializer registered for <key>` (lib/serialization/ObjectMiddleware.js:350-356). The cache references a serializer that the current webpack/plugin set never registered.","triggerScenarios":"Reading a persistent cache that was written by a build where a plugin/serializer was loaded, but the current build does not load that plugin (or loads a version without that serializer). The key in the cache has no matching `serializerInversed` entry.","commonSituations":"Disabling or removing a plugin whose types were previously cached; downgrading webpack or a plugin that no longer registers a class; loading plugins conditionally so the serializer set differs between builds; team members with different plugin configurations sharing a cache.","solutions":["Delete the persistent cache so it rebuilds under the current set of registered serializers.","Ensure the plugin that registers the serializer is loaded on every build that reads the cache.","Keep the plugin set (and versions) consistent across team/CI.","Set/bump `cache.version` when the plugin set changes so webpack invalidates the cache itself."],"exampleFix":"// before: plugin A registered 'my-pkg/MyDep', then A was disabled -> cache read fails\n// after: either re-enable the plugin, or invalidate the cache\nconfig.cache = { type: 'filesystem', version: 'pluginset-v2' }; // bump on change","handlingStrategy":"validation","validationCode":"// Before reading the cache, assert every serializer the build can write is also loadable\nconst { ObjectMiddleware } = require('webpack/lib/serialization/ObjectMiddleware');\nfunction assertDeserializer(request, name) {\n  if (ObjectMiddleware._getDeserializerForWithoutError(request, name) === undefined)\n    throw new Error(`missing deserializer for ${request}/${name}; load the owning plugin`);\n}","typeGuard":null,"tryCatchPattern":"compiler.hooks.failed.tap('DeserializerGuard', (err) => {\n  if (/No deserializer registered for/.test(err.message)) {\n    require('fs').rmSync(cacheLocation, { recursive: true, force: true });\n    console.error('Cache referenced an unregistered serializer; purged. Rebuild.');\n  }\n});","preventionTips":["Keep the plugin set (and versions) identical across builds sharing a cache.","Bump `cache.version` whenever the plugin set changes.","Delete the cache after removing or downgrading a plugin."],"tags":["serialization","object-middleware","cache","plugin","versioning","persistence"],"analyzedSha":"318421ea8ac81371f5171236a6efb63675576528","analyzedAt":"2026-08-03T19:39:56.731Z","schemaVersion":2}