question-mark
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.

Uncaught TypeError: Cannot read property 'tokenizePlaceholders' of undefined

See original GitHub issue

I updated prism to 1.14.0 because I needed to support another language and since then I get the following error on my page:

prism.js:formatted:1119 Uncaught TypeError: Cannot read property 'tokenizePlaceholders' of undefined
    at prism.js:formatted:1119
    at Object.run (prism.js:formatted:249)
    at Object.highlight (prism.js:formatted:154)
    at Object.highlightElement (prism.js:formatted:139)
    at Object.highlightAllUnder (prism.js:formatted:97)
    at HTMLDocument.highlightAll (prism.js:formatted:88)

If I follow prism.jsformatted:1119 I get to the following code:

e.hooks.add("after-tokenize", function(n) {
   e.languages["markup-templating"].tokenizePlaceholders(n, "php")
})

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Volmargcommented, Aug 30, 2020

In my case I had this import Prism from 'prismjs';

should’ve been:

import * as Prism from 'prismjs';

0reactions
jwillmercommented, May 16, 2018

Now it works, thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'tokenizePlaceholders' of undefined ...
Hello, When I use version 1.14.0 in node.js, I get an undefined error ... Uncaught TypeError: Cannot read property 'tokenizePlaceholders' of ...
Read more >
Uncaught TypeError: Cannot read properties of undefined ...
The above config causes the file gets loaded as a string that points to its URL, but the code assumes a JS object...
Read more >
Cannot read properties of undefined' - JavaScript Debugging
JavaScript Tutorial. How To Fix ' Uncaught TypeError : Cannot read properties of undefined ' - JavaScript Debugging. 26K views 6 months ago....
Read more >
Use error report in vue3? | v-md-editor - GitHub Pages
Vuepress theme quotes php language pack error? Error:Cannot read property 'tokenizePlaceholders' of undefined. Solution: // Before introducing the php language ...
Read more >
Uncaught TypeError: Cannot read property 'call' of undefined
Uncaught TypeError : Cannot read property 'call' of undefined. I keep getting this error on the Javascript console and the page won't load,...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found