highlightjs / vue-plugin

Highlight.js Vue Plugin
BSD 3-Clause "New" or "Revised" License
201 stars 27 forks source link

'highlight.js/lib/common' does not exist #16

Closed jannikbuscha closed 3 years ago

jannikbuscha commented 3 years ago

'highlight.js/lib/common' does not exist: image image

To fix the error in the docu, the following must be imported: import hljs from "@highlightjs/vue-plugin/node_modules/highlight.js/lib/common";

image

You also need to import the styling: @import "./node_modules/@highlightjs/vue-plugin/node_modules/highlight.js/scss/base16/darcula";

highlight.js in the node modules is also useless.

joshgoebel commented 3 years ago

'highlight.js/lib/common' does not exist:

It most certainly does in the latest release. I think the issue is your non-vue vendored version is older?

You also need to import the styling:

If we don't document this it could certainly be added to the README. PR welcome.

highlight.js in the node modules is also useless.

Huh?

joshgoebel commented 3 years ago

If the answer here isn't sufficient I'm guessing this should also be closed by #17? If not please continue the conversation and we'll see what we can do to help! Thanks.

jannikbuscha commented 3 years ago

'highlight.js/lib/common' does not exist:

It most certainly does in the latest release. I think the issue is your non-vue vendored version is older?

You also need to import the styling:

If we don't document this it could certainly be added to the README. PR welcome.

highlight.js in the node modules is also useless.

Huh?

I have expressed myself somewhat unclearly. I just meant that highlights.js is unnecessary as an additional dependency in the node modules, but the fix with the peer dependency should have fixed that