js error like ''sweetalert2.default is not a function''
See original GitHub issuebelow is my implementation:
import SweetAlert from 'sweetalert2'
SweetAlert('hello test')
I installed it by npm install and pretty sure ‘sweetalert2’ folder is ialready nside node_modules/ folder but that will cause js error like ‘sweetalert2.default is not a function’
No idea how to fix it (I previously used the original version of sweetalert but it works well in such way).
Thanks~
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:13 (11 by maintainers)
Top Results From Across the Web
sweetalert2_react_content_1.default is not a function - Stack ...
I want to use html within a Swal-component, and that just doesn't work. Here is my code: import Swal from "sweetalert2"; import withReactContent ......
Read more >SweetAlert2 (Swal is not defined) How to solve? - jQuery Forum
When I click the button, no action is taken. On the "Console" I get the following message: "Uncaught ReferenceError: Swal is not defined"....
Read more >Sweet Alert - Common Style Inventory
Here's a comparison of a standard error message. The first one uses the built-in alert-function, while the second is using sweetAlert.
Read more >SweetAlert2 (Advance version of SweetAlert) - GeeksforGeeks
The sweet JS Provides easy methods to design and add a lot of functionality to the alert box of the website by just...
Read more >SweetAlert2 - a beautiful, responsive, customizable and ...
A beautiful, responsive, customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes.
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
I just released v3.0.0
@Tonkpils
Switched to es6-promise: https://github.com/limonte/sweetalert2/commit/b7a6a0dec56323c5de4342e907f00e5290d8f3ac