-
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
Typings error TS2403: Subsequent variable declarations must have the same type. #890
Comments
Same issue, same situation. However, I noticed that just commenting out the line |
same issue |
Same issue. |
Also same issue. CI builds failing because of this. |
I think this line have to removed: sweetalert/src/sweetalert.d.ts Line 4 in bfd0e63
|
Fixes t4t5#890 ``` ERROR in node_modules/sweetalert/typings/sweetalert.d.ts(4,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'swal' must be of type 'typeof import("C:/proj/node_modules/sweetalert/typings/sweetalert")', but here has type 'SweetAlert'. ```
Fixes t4t5#890 ``` ERROR in node_modules/sweetalert/typings/sweetalert.d.ts(4,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'swal' must be of type 'typeof import("C:/proj/node_modules/sweetalert/typings/sweetalert")', but here has type 'SweetAlert'. ```
Fixes t4t5#890 ``` ERROR in node_modules/sweetalert/typings/sweetalert.d.ts(4,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'swal' must be of type 'typeof import("C:/proj/node_modules/sweetalert/typings/sweetalert")', but here has type 'SweetAlert'. ```
Fixes t4t5#890 ``` ERROR in node_modules/sweetalert/typings/sweetalert.d.ts(4,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'swal' must be of type 'typeof import("C:/proj/node_modules/sweetalert/typings/sweetalert")', but here has type 'SweetAlert'. ```
Fixes t4t5#890 ``` ERROR in node_modules/sweetalert/typings/sweetalert.d.ts(4,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'swal' must be of type 'typeof import("C:/proj/node_modules/sweetalert/typings/sweetalert")', but here has type 'SweetAlert'. ```
I have this same issue when running under OpenBSD. Yes I know not a mainstream OS, but the version of TypeScript available makes anything with sweetalert unusable :( |
1 similar comment
I have this same issue when running under OpenBSD. Yes I know not a mainstream OS, but the version of TypeScript available makes anything with sweetalert unusable :( |
@t4t5 Can you take a look on this issue? |
Also experiencing this with Angular 7 |
Any idea on a workaround apart from editing the definition file manually? It's becoming a bit of a hassle remembering to do that after every clone / npm install. |
@bogdan-calapod Here's what I have been doing as a workaround, so that our CI build doesn't fail:
|
Hi all, Save yourself the effort and use sweetalert 2 https://sweetalert2.github.io/ |
resolving issue t4t5#890
Any updates with this issue? |
This have support for 3 buttons or more? @DVGalarza this workaround didn't worked for me. ReferenceError: "swal is not defined" is what i'm getting. |
@alvarofelipe12 In the file you are trying to use 'swal' in, did you add |
my alternative was to rename const swal to const _swal import swal, { SweetAlert } from "./core"; declare global { export default swal; |
hello !, same issue |
I fixed this by overriding the sweetalert types. I added a file in the src dir named
|
Solved it by changing this line:
to:
or (with the interface):
|
I'm having the same issue in Angular 10. Yeah, the problem seems to be in @drmencos Is that for Node.js? |
En el archivo: node_modules>sweetalert>typings>sweetalert.d.ts import swal, { SweetAlert } from "./core"; declare global { export default swal; |
changing |
Not fixed yet? any ideas? |
Im trying to use environment variables and I fired the following commands: only to get this error, error TS2403: Build:Subsequent variable declarations must have the same type. Variable 'process' must be of type 'Process', but here has type '{ env: { NG_APP_ENV: string; NG_APP_BASEURL: string; }; }'. the error is coming from my env.d.ts file. |
This works for me. Create a import swal from "sweetalert/typings/core";
declare global {
const swal: typeof swal;
const sweetAlert: typeof swal;
}
export default swal;
export as namespace swal; |
Upgraded to Angular 7 w/ TypeScript 3.2.4 and am now getting the following whenever I compile:
If I edit
node_modules/sweetalert/typings/sweetalert.d.ts
from...... to ...
... it starts working.
Any ideas?
The text was updated successfully, but these errors were encountered: