{"record":{"id":"5452517b1cef613f","repo":"ueberdosis/tiptap","slug":"you-should-provide-an-instance-of-lowlight-to-use","errorCode":null,"errorMessage":"You should provide an instance of lowlight to use the code-block-lowlight extension","messagePattern":"You should provide an instance of lowlight to use the code-block-lowlight extension","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/extension-code-block-lowlight/src/lowlight-plugin.ts","lineNumber":89,"sourceCode":"  return DecorationSet.create(doc, decorations)\n}\n\n// oxlint-disable-next-lineno-unsafe-function-type\nfunction isFunction(param: any): param is Function {\n  return typeof param === 'function'\n}\n\nexport function LowlightPlugin({\n  name,\n  lowlight,\n  defaultLanguage,\n}: {\n  name: string\n  lowlight: any\n  defaultLanguage: string | null | undefined\n}) {\n  if (!['highlight', 'highlightAuto', 'listLanguages'].every(api => isFunction(lowlight[api]))) {\n    throw Error(\n      'You should provide an instance of lowlight to use the code-block-lowlight extension',\n    )\n  }\n\n  const lowlightPlugin: Plugin<any> = new Plugin({\n    key: new PluginKey('lowlight'),\n\n    state: {\n      init: (_, { doc }) =>\n        getDecorations({\n          doc,\n          name,\n          lowlight,\n          defaultLanguage,\n        }),\n      apply: (transaction, decorationSet, oldState, newState) => {\n        const oldNodeName = oldState.selection.$head.parent.type.name\n        const newNodeName = newState.selection.$head.parent.type.name","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/ueberdosis/tiptap/blob/496d53afd7e4e3c7424b4749adeff4f45e27ddb0/packages/extension-code-block-lowlight/src/lowlight-plugin.ts#L71-L107","documentation":"Error \"You should provide an instance of lowlight to use the code-block-lowlight extension\" thrown in ueberdosis/tiptap.","triggerScenarios":"Thrown at packages/extension-code-block-lowlight/src/lowlight-plugin.ts:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"496d53afd7e4e3c7424b4749adeff4f45e27ddb0","analyzedAt":"2026-08-26T22:41:43.400Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}