Problem
I'm getting the following error when recreating the code block highlight example:
Invalid syntax highlight definitions: define at least one highlight.js language mapping.
I've installed highlight.js, imported it and passed on the languages object as described in the example.
I'm unsure as to how to debug this unfortunately. I've tried a few different things but can't seem to get it working. Any help would be appreciated!
Screenshots


Environment
For anyone facing this problem, checkout this
https://github.com/scrumpy/tiptap/blob/92eb2c61ccf2780c51212724fd879ba343436bd3/packages/tiptap-extensions/src/nodes/CodeBlockHighlight.js#L11-L13
You can try the following
new CodeBlockHighlight({
options: {
languages: { javascript, css, xml, python, java, clike },
}
})
Code is not highlighting
"tiptap": "^1.27.1",
"tiptap-extensions": "^1.29.1",
I am facing the same issue. I even copy-pasted the index.vue file directly from the source and ran it as a separate component. no joy.
After debugging the source of tiptap-extensions, I've found that the actual error has nothing to do with how you pass languages. It still should be:
new CodeBlockHighlight({
languages: { javascript, css, xml }
})
The error however is the following:

Apparently it comes from version mismatch of the highlight.js. In my package.json I have ^10.1.1, but lowlight depends on version 9.16.2. Fixed the issue by setting the version of highlight.js to ^9.16.2 in the package.json:
{
// ...
"dependencies": {
"highlight.js": "^9.16.2"
},
// ...
}
Thank you so much! I really wanted this to work. Does anybody know how I can use all languages available?
I can鈥檛 reproduce the issue, so I guess it鈥檚 fixed by now? I鈥檓 closing this here for now, but feel free to chime in if you think it鈥檚 still relevant. 鉁岋笍
Most helpful comment
After debugging the source of
tiptap-extensions, I've found that the actual error has nothing to do with how you pass languages. It still should be:The error however is the following:
Apparently it comes from version mismatch of the
highlight.js. In mypackage.jsonI have^10.1.1, butlowlightdepends on version9.16.2. Fixed the issue by setting the version ofhighlight.jsto^9.16.2in thepackage.json: