Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hljs.highlight is not a function #29

Open
dbruning opened this issue Jul 1, 2020 · 4 comments · May be fixed by #73
Open

hljs.highlight is not a function #29

dbruning opened this issue Jul 1, 2020 · 4 comments · May be fixed by #73
Assignees
Labels

Comments

@dbruning
Copy link

dbruning commented Jul 1, 2020

I got this error (hljs.highlight is not a function) and it turned out to be because highlight.js revved to 10.1.1, and somewhere along the line it's now incompatible with vue-highlight.js

Workaround is to set the highlight.js version to ^9.11.0 in package.json.

Might want to revisit the decision not to Move highlight.js from peerDependencies into dependencies

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.76. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@bramchi
Copy link

bramchi commented Sep 14, 2020

I had a similar error message:

registerLanguage is not a function

Downgrading highlight.js to ^9.11.0 fixed that.

Thanks for the pointer!

@gluons gluons self-assigned this Sep 15, 2020
@baijifeilong
Copy link

highlightjs support Vue officially now.

import hljs from "highlight.js"
import "highlight.js/styles/github.css"
Vue.use(hljs.vuePlugin);
<highlightjs language='javascript' code="var x = 5;" />

@gluons gluons linked a pull request Jan 3, 2021 that will close this issue
3 tasks
@gluons
Copy link
Owner

gluons commented Jan 31, 2021

Version 4 was released.
You can try it via npm install vue-highlight.js@next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants