Highlight.js: Demo: Code error

Created on 22 Sep 2018  Â·  8Comments  Â·  Source: highlightjs/highlight.js

Code error in index.html file. Code not executed.

Most helpful comment

@neooblaster For developer.html build with nodejs tools/build.js -n.

All 8 comments

@Suyash2810 can you elaborate more on this? What is your file, what error you get etc., so we can reproduce the issue.

In the demo folder, there is index.html file and demo.js which on opening clearly is showing execution failure.
There is a list of errors being shown. They are as follows :


Failed to load resource: the server responded with a status of 404 (Not Found)
Failed to load resource: the server responded with a status of 404 (Not Found)
Failed to load resource: the server responded with a status of 400 (Bad Request)
demo.js:29 Uncaught ReferenceError: hljs is not defined
at HTMLDivElement. (demo.js:29)
at Function.each (jquery-2.1.1.min.js:2)
at n.fn.init.each (jquery-2.1.1.min.js:2)
at selectCategory (demo.js:22)
at HTMLLIElement. (demo.js:80)
at HTMLLIElement.dispatch (jquery-2.1.1.min.js:3)
at HTMLLIElement.r.handle (jquery-2.1.1.min.js:3)
at Object.trigger (jquery-2.1.1.min.js:3)
at HTMLLIElement. (jquery-2.1.1.min.js:3)
at Function.each (jquery-2.1.1.min.js:2)

Failed to load resource: the server responded with a status of 404 (Not Found)
Failed to load resource: the server responded with a status of 404 (Not Found)

I hope this helps.

@Suyash2810 Please see demo/readme.md:

To view this demo in browser, please follow the build instructions with browser as the target, and then open the generated build/demo/index.html.

Hi all,

I have similar error with tools/developer.html after building enviro with tools/build.js -t node
The developer.html page looking for ../build/highlight.pack.js.
When I change path to built file highlight.js in lib folder, I have 'require' not defined.

What I'm doing wrong ?
Thanks for your help.

Regards
Nicolas DUPRE

@neooblaster For developer.html build with nodejs tools/build.js -n.

Hi egor-rogov,
I do not want to floot this thread but that works perfectly .I want to make a review for a pull request.

My file highlighjs/build/demo/index.html works without error with language that I want to review.

Thanks a lot.

@neooblaster, you are welcome.

Looks like the issue can be closed. Feel free to reopen if something remained unanswered.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhouxy666 picture zhouxy666  Â·  3Comments

Rarst picture Rarst  Â·  8Comments

niche4u picture niche4u  Â·  5Comments

sustained picture sustained  Â·  4Comments

gka picture gka  Â·  7Comments