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.

Promise module throws Uncaught ReferenceError

See original GitHub issue

Current behavior

According to the documentation, we can optionally include a promise polyfill for ES6 Promises for compatibility with IE11:

<script defer src="https://cdn.jsdelivr.net/npm/promise-polyfill"></script>

Since a few days, however, this produces an error in the browser console: Uncaught ReferenceError: module is not defined

The error appears to be on row 324 in index.js:

module.exports = Promise;

Expected behavior

No Uncaught ReferenceError should be thrown.

Live demo

Just go to any website that uses sweetalert2 (e.g. https://www.appenhancer.com/) and the error should appear in the browser console.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ghostcommented, Feb 9, 2021

Sorry, not sure what you mean. I read the docs on your homepage (see the attached image). I looked at the page you sent the link to; do you mean that that is the url to use (https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.js) instead of the one on your homepage?

Screenshot 2021-02-09 at 09 27 01
0reactions
ghostcommented, Feb 9, 2021

By the way, found a visibility issue now that the link is longer (see attached image). Screenshot 2021-02-09 at 14 16 03

Read more comments on GitHub >

github_iconTop Results From Across the Web

Client on Node.js: Uncaught ReferenceError: require is not ...
throws the Uncaught ReferenceError: require is not defined. I was able to work around that by specifying Node.js integration as true when the...
Read more >
ReferenceError: "x" is not defined - JavaScript - MDN Web Docs
ReferenceError : "x" is not defined. The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
Read more >
Jest mock referenceerror cannot access before initialization
ReferenceError : Cannot access 'Foo' before initialization. log( num1); Copy to Clipboard. ensureIndex is deprecated; electronjs require is not defined; ...
Read more >
JavaScript: Uncaught TypeError: n is not a function
This is a standard JavaScript error when trying to call a function before it is defined. This error occurs if you try to...
Read more >
ReferenceError: require is not defined in JavaScript | bobbyhadz
To solve the "ReferenceError require is not defined" error, use the ES6 module import and export syntax. The require() function is Node.js specific...
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