ueberdosis/tiptap · error · Error
You should provide an instance of lowlight to use the code-b
Error message
You should provide an instance of lowlight to use the code-block-lowlight extension
What it means
Error "You should provide an instance of lowlight to use the code-block-lowlight extension" thrown in ueberdosis/tiptap.
Source
Thrown at packages/extension-code-block-lowlight/src/lowlight-plugin.ts:89
return DecorationSet.create(doc, decorations)
}
// oxlint-disable-next-lineno-unsafe-function-type
function isFunction(param: any): param is Function {
return typeof param === 'function'
}
export function LowlightPlugin({
name,
lowlight,
defaultLanguage,
}: {
name: string
lowlight: any
defaultLanguage: string | null | undefined
}) {
if (!['highlight', 'highlightAuto', 'listLanguages'].every(api => isFunction(lowlight[api]))) {
throw Error(
'You should provide an instance of lowlight to use the code-block-lowlight extension',
)
}
const lowlightPlugin: Plugin<any> = new Plugin({
key: new PluginKey('lowlight'),
state: {
init: (_, { doc }) =>
getDecorations({
doc,
name,
lowlight,
defaultLanguage,
}),
apply: (transaction, decorationSet, oldState, newState) => {
const oldNodeName = oldState.selection.$head.parent.type.name
const newNodeName = newState.selection.$head.parent.type.nameView on GitHub (pinned to 496d53afd7)
When it happens
Trigger: Thrown at packages/extension-code-block-lowlight/src/lowlight-plugin.ts:89 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of ueberdosis/tiptap@496d53afd7 (2026-08-26).
Data as JSON: /api/errors/5452517b1cef613f.
Report an issue: GitHub.