Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Mark is not defined" error when using mark.js located in dist folder

See original GitHub issue

I need a pure javascript plugin that works with IE 9+ to highlight a given regex expression. I found Mark.js and I managed to make it work, but not with the file recommended in the docs that is inside the /dist/ folder.I’ve tried with both 8.9.1 and 8.10.0 versions.

Steps to reproduce

1 - Added the javascript library in the header tag. Note that this file is inside the dist folder, like is said in the docs. I’ve tried with both “mark.es6.js” and “mark.js”, but what I really want to be working is the ES5 version.

<script type="text/javascript" src="dist/mark.js" charset="UTF-8"></script>

2 - So, in the chrome developer tools console I’ve typed:

new Mark(document.querySelector("#div"));

this didn’t work and give me this output:

Uncaught ReferenceError: Mark is not defined
at <anonymous>:1:1

It worked with mark.js located in /src/ folder though. I’ve created a questions in stackoverflow too:


  • Browser name and version Google Chrome 60.0.3112.90 64 bits

  • mark.js version I’ve tried with both v8.9.1 and v8.10.0.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

marcogalicia25commented, Sep 17, 2019

come on! someone provides the zip we have the same issue!!! and it is 2019!!!

julmotcommented, Feb 22, 2018

Like mentioned above, I need a test ZIP example to help you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trying to use mark.js ES5 and ES6 version without JQuery, but ...
I found Mark.js and I managed to make it work, but not with the file recommended in the docs that is inside the...
Read more >
mark.js – JavaScript keyword highlight
js is a text highlighter written in JavaScript. It can be used to dynamically mark search terms or custom regular expressions and offers...
Read more >
Docs • Svelte
With this, npm run build will generate HTML, JS and CSS files inside the dist directory. The Svelte team maintains a VS Code...
Read more >
How to use ESLint with TypeScript | Khalil Stemmler
ESLint is a JavaScript linter that you can use to lint either TypeScript or JavaScript code. In this post, we'll walk through how...
Read more >
Node.js v19.3.0 Documentation
Features are marked as legacy rather than being deprecated if their use does no ... message <string> If provided, the error message is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found