Version mismatch for module @ionic-native/dialogs


#1

Hi,

I get the following error

Error: Metadata version mismatch for module /www/projects/project/node_modules/@ionic-native/dialogs/index.d.ts, found version 4, expected 3 …

when I run

$ ionic cordova build browser --prod

It’s working when I build without --prod

Env. info

$ ionic info
cli packages: (projects/project/node_modules)

    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0

global packages:

    cordova (Cordova CLI) : 6.5.0 

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : browser 4.1.0
    Ionic Framework    : ionic-angular 3.6.0

System:

    Node : v7.10.1
    npm  : 4.2.0 
    OS   : Linux 4.4

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy


I need to publish new feature that uses Dialogs module by tomorrow so I would really appreciate any help…

thanks…


#2

I found out that npm installed latest version of plugin that is 4.4.0…
Every other plugin was at version 3.12.1 so I changed the version of Dialogs plugin and installed it and that fixed my problem


#3

Hi devmaster!
I am using ionic 3 and I haved checked the problem plugin as below

    <plugin name="cordova-plugin-app-update" spec="~1.4.11" />
    <plugin name="cordova-plugin-app-version" spec="~0.1.9" />

so I encountered the same problem like yours.

Metadata version mismatch for module D:/Development/Projects/Web apps/IUEducation/client/New folder/Myionicapp/node_modules/@ionic-native/app-version/index.d.ts, found version 4, expected 3
    at StaticSymbolResolver.getModuleMetadata (D:\Development\Projects\Web apps\IUEducation\client\New folder\Myionicapp\node_modules\@angular\compiler\bundles\compiler.umd.js:25748:34)
    at StaticSymbolResolver._createSymbolsOf (D:\Development\Projects\Web apps\IUEducation\client\New folder\Myionicapp\node_modules\@angular\compiler\bundles\compiler.umd.js:25536:46)
    at StaticSymbolResolver.getSymbolsOf (D:\Development\Projects\Web apps\IUEducation\client\New folder\Myionicapp\node_modules\@angular\compiler\bundles\compiler.umd.js:25517:14)
    at D:\Development\Projects\Web apps\IUEducation\client\New folder\Myionicapp\node_modules\@angular\compiler\bundles\compiler.umd.js:24376:30
    at Array.forEach (native)
    at extractProgramSymbols (D:\Development\Projects\Web apps\IUEducation\client\New folder\Myionicapp\node_modules\@angular\compiler\bundles\compiler.umd.js:24375:79)
    at AotCompiler.analyzeModulesAsync (D:\Development\Projects\Web apps\IUEducation\client\New folder\Myionicapp\node_modules\@angular\compiler\bundles\compiler.umd.js:23931:47)
    at CodeGenerator.codegen (D:\Development\Projects\Web apps\IUEducation\client\New folder\Myionicapp\node_modules\@angular\compiler-cli\src\codegen.js:32:14)
    at Function.NgTools_InternalApi_NG_2.codeGen (D:\Development\Projects\Web apps\IUEducation\client\New folder\Myionicapp\node_modules\@angular\compiler-cli\src\ngtools_api.js:73:30)
    at Object.doCodegen (D:\Development\Projects\Web apps\IUEducation\client\New folder\Myionicapp\node_modules\@ionic\app-scripts\dist\aot\codegen.js:6:51)

can you help me ?
and my ionic info is:


    @ionic/cli-utils  : 1.16.0
    ionic (Ionic CLI) : 3.16.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : android 6.2.3 ios
    Ionic Framework    : ionic-angular 3.7.1

System:

    Node : v6.11.2
    npm  : 3.10.10 
    OS   : Windows 10

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy


#4

It’s ok now… My way to solve this kind of problem was to make every ionic/native plugin using 4.3.3

 "@angular/common": "4.4.4",
        "@angular/compiler": "4.4.4",
        "@angular/compiler-cli": "4.4.4",
        "@angular/core": "4.4.4",
        "@angular/forms": "4.4.4",
        "@angular/http": "4.4.4",
        "@angular/platform-browser": "4.4.4",
        "@angular/platform-browser-dynamic": "4.4.4",
        "@ionic-native/action-sheet": "4.3.3",
        "@ionic-native/android-full-screen": "4.3.3",
        "@ionic-native/app-minimize": "4.3.3",
        "@ionic-native/app-update": "4.3.3",
        "@ionic-native/app-version": "4.3.3",
        "@ionic-native/camera": "4.3.3",
        "@ionic-native/core": "4.3.3",
        "@ionic-native/device": "4.3.3",
        "@ionic-native/file": "4.3.3",
        "@ionic-native/file-path": "4.3.3",
        "@ionic-native/file-transfer": "4.3.3",
        "@ionic-native/geolocation": "4.3.3",
        "@ionic-native/image-resizer": "4.3.3",
        "@ionic-native/in-app-browser": "4.3.3",
        "@ionic-native/media": "4.3.3",
        "@ionic-native/network": "4.3.3",
        "@ionic-native/screen-orientation": "4.3.3",
        "@ionic-native/splash-screen": "4.3.3",
        "@ionic-native/sqlite": "4.3.3",
        "@ionic-native/status-bar": "4.3.3",
        "@ionic-native/toast": "4.3.3",
        "@ionic-native/unique-device-id": "4.3.3",

and remove the node_modules folder and then npm install