-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Angular 5.2.3 - ERROR TypeError: sweetalert_1.default is not a function #799
Comments
I started having this error when I uncommented the following lines so that my project could be compatible with IE9, 10 and 11. Located in Changing the "target" to es6 as you suggest breaks my app on IE 11 since apparently es6 arrow functions aren't yet supported on IE 11 and compiling my project will throw an error. |
+1 |
I'm having the same error! |
me,too. |
I solved the issue by swaping to sweetalert 2. Im not sure if its developed by the same team (so im sorry for the propaganda if not). |
Hey guys. Do you still get any errors when running Alternatively, you could use this somewhat dirty workaround: import * as _swal from 'sweetalert';
import { SweetAlert } from 'sweetalert/typings/core';
const swal: SweetAlert = _swal as any;
swal('test'); |
@lionralfs It works fine. |
@lionralfs you are a true lion work fine. |
The npm release doesn't export a The documentation suggests to use The matching import looks like this: import swal = require("sweetalert"); Yes, it's nonstandard syntax, which will cause problems for users targeting ES modules. By enabling synthetic imports or using the |
Great! im done |
Edit node_modules/sweetalert/typings/sweetalert.d.ts from...
to...
|
I had the same issue with ReactJS, but using https://github.com/sweetalert/sweetalert-with-react fixed it |
I am getting this error while using es5. But it works fine on es6.
sweetalert version : 2.1.0
tsconfig.json
The text was updated successfully, but these errors were encountered: