amitmahida92 / ng4-loading-spinner

Angular 4 custom async loading spinner.
MIT License
69 stars 31 forks source link

Metadata version mismatch found version 4, expected 3 #19

Open deQuota opened 6 years ago

deQuota commented 6 years ago

Metadata version mismatch for module ../ng4-loading-spinner/ng4-loading-spinner.d.ts, found version 4, expected 3, Getting error above , "@angular/core": "^4.4.6", "ng4-loading-spinner": "^1.1.1",

alexfeds commented 6 years ago

same issue ../ng4-loading-spinner/ng4-loading-spinner.d.ts, found version 4, expected 3,

burhangul commented 6 years ago

i have same error

alexfeds commented 6 years ago

To get it working in Angular 4, you can use older version of the spinner, in package.json include this version, "ng4-loading-spinner": "1.0.27", run npm i --save. And use this tags<app-spinner> </app-spinner> in root html component

mallika-chawda commented 6 years ago

The above works when I am just building using ng build but fails when I use ng build --prod. Any fix for the same?

amitmahida92 commented 6 years ago

@deQuota , @alexfeds @burhangul @mallika-chawda Please update your all angular dependencies to 5.x and update your @angular/cli to 1.5.x. This resolves the issue. I have verified the same.

Thanks.

kalyank23 commented 6 years ago

@amitmahida92 I wrote my project on angular 4 so it will be difficult for me to update to angular 5 as there are lot of other dependeicies, so could you suggest other solutions for this issue.

alexfeds commented 6 years ago

@kalyank23 I am also doing project in Angular 4, you can still use it by method I have described

kalyank23 commented 6 years ago

@alexfeds Hi, thank you for your response. If I install 1.0.27 then getting the error as in https://github.com/amitmahida92/ng4-loading-spinner/issues/9 so when I install 1.1.1 version then again the issue is same. Could you share the sample code on how to use with 1.0.27

alexfeds commented 6 years ago

@kalyank23 can you tell me what version of Angular 4 you using? I am not sure but the problem can be that even you install different version its still locked in package-lock.json. So go to package-lock.json and double check that the version is "1.0.27" (make sure there is no ^ symbol, otherwise it will pull other version) and it should be the same in package.json file.

package-lock.json

"ng4-loading-spinner": { "version": "1.0.27", "resolved": "https://registry.npmjs.org/ng4-loading-spinner/-/ng4-loading-spinner-1.0.27.tgz", "integrity": "sha1-7HrRKbXcG1VZY7WvQQc2vISmPs4=", "requires": { "@angular/core": "4.4.6", "rxjs": "5.5.2", "zone.js": "0.8.18" } },

package.json

"ng4-loading-spinner": "1.0.27",

After that run npm -i --save. Hope it helps

byhoratiss commented 6 years ago

I've also met this problem, and using v1.0.27 works differently, configuration and methods are different, and I cannot update my dependencies to angular 5 so I've to let go this module :(

kalyank23 commented 6 years ago

I made it work in my angular 4 code by downloading the ng4-loading-spinner 1.0.27 in my local machine, and using this code as a one more component for my project. Just download and extract to your project and arrange the import statements in your project then you will get it work.

lesiba7 commented 6 years ago

I use angular 4 and downgrading works, Downgrade to v1.0.27 as mentioned above and remove the forRoot() on the main module's imports ( from Ng4LoadingSpinnerModule.forRoot() to Ng4LoadingSpinnerModule).

RkReddy88 commented 6 years ago

@lesiba7 I tried the same thing to downgrade the version to v1.0.27 and changes as you mentioned but still not able to publish the application with the following exception,

image

and this is my package.json image

enjniranjan commented 6 years ago

I also had the same issue in my project , I followed these things:

1) downgraded ng4-loading-spinner to 1.0.27 2) changed Ng4LoadingSpinnerModule.forRoot() to Ng4LoadingSpinnerModule in app.module.ts. 3) changed "ng4-loading-spinner" to "app-spinner" in html.

And it worked fine for me.

suchetaswabhav commented 6 years ago

Hi, even i am facing the same error -

ERROR in Error: Metadata version mismatch for module /home/dell/Downloads/Datshare/Adaani5.0 (another copy).0/node_modules/ng4-loading-spinner/ng4-loading-spinner.d.ts, found version 4, expected 3, resolving symbol MasterSystemModule in /home/dell/Downloads/Datshare/Adaani5.0 (another ..... ....

And i tried @enjniranjan and @lesiba7 and @alexfeds answers ... but none worked for me

amitmahida92 commented 6 years ago

Hello @suchetaswabhav , Can i have the details of you package.json please?

jnthnlxmn2 commented 6 years ago

@alexfeds thanks! works fine to me