Promise module throws Uncaught ReferenceError
See original GitHub issueCurrent 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:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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?
By the way, found a visibility issue now that the link is longer (see attached image).