-
Notifications
You must be signed in to change notification settings - Fork 127
highlight.js not detected! #78
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
Comments
because of import is asynchronous,you can use like this:
because of 'highlightjs-line-numbers.js' check window.hljs is exist,so you need to set window.hljs = hljs,or it will be show error message like 'highlight.js not detected! ' |
@qinchao888 Thanks, it did fix it. but apparently |
I was only able to get line numbers to work like this.
|
Describe the bug
I'm trying to use this package. even though I import it after
highlight.js
, it keeps throwinghighlight.js not detected!
To Reproduce
Steps to reproduce the behavior:
First of all I'm using Webpack with this config:
I installed
highlight.js
andhighlightjs-line-numbers.js
using npm.I imported them this way (using es6 import/export):
and it throws:

I also tried to import
highlight.js
this way. still throws the same errorExpected behavior
To detect
highlight.js
Desktop (please complete the following information):
webpack version: 4.44.1
highlight.js version: 10.2.1
highlightjs-line-numbers.js version: 2.8.0
The text was updated successfully, but these errors were encountered: