Skip to content
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

TypeError: e is null #2105

Closed
ThwCorbin opened this issue Nov 1, 2019 · 2 comments · Fixed by #2106
Closed

TypeError: e is null #2105

ThwCorbin opened this issue Nov 1, 2019 · 2 comments · Fixed by #2106

Comments

@ThwCorbin
Copy link

Information:

  • Prism version: PrismJS 1.17.1
  • Plugins: none
  • Environment: Node, 11ty static site generator, Rollup bundler, Netlify CDN

Description
Prism is working fine, although I get a type error when pages load. Here is the type error:

  • In Chrome: Uncaught TypeError: Cannot read property 'defer' of null
  • In Firefox: TypeError: e is null

Here is the code the type error references:

    var e = _.util.currentScript();

    if (e && (_.filename = e.src, e.hasAttribute("data-manual") && (_.manual = !0)), !_.manual) {
      var n = function n() {
        _.manual || _.highlightAll();
      };

      var t = document.readyState;
      "loading" === t || "interactive" === t && e.defer ? document.addEventListener("DOMContentLoaded", n) : window.requestAnimationFrame ? window.requestAnimationFrame(n) : window.setTimeout(n, 16);
    }

I am not using prismjs and babel-plugin-prismjs packages, as directed in the Prism docs "Usage with Webpack, Browserify, & Other Bundlers" as I cannot get this setup to work with my bundler, Rollup. Instead, I've pasted the prism.js code into the bottom of my script.js, which Rollup bundles.

Example
This is the website where I have the bug: https://www.thwcorbin.com
And here is the code in my repository: https://github.com/ThwCorbin/toms-site/blob/master/src/assets/js/script.js

@RunDevelopment
Copy link
Member

Thank you for reporting!

I made a fix for the issue (I caused; truely sorry), so the fix will be available as soon as #2106 is merged.

@ThwCorbin
Copy link
Author

ThwCorbin commented Nov 1, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants