Hello everyone,
I am going crazy! suddenly an old cordova project doesn’t compile. I was working on migrating to capacitor.
I think the problem appeared after installing one of the following plugins:
@codetrix-studio/capacitor-google-auth
@capacitor-community/facebook-login
@capacitor-community/apple-sign-in
I’m looking for someone who can give me some useful advice to solve the compatibility problem.
Environment:
O.S. Windows 10
Node 18.13.0
Angular 13.x
Ionic build
> ng.cmd run app:build
√ Browser application bundle generation complete.
./node_modules/moment/src/lib/locale/locales.js:85:12-46 - Warning: Module not found: Error: Can't resolve './locale' in 'C:\projects\my-app-capacitor\node_modules\moment\src\lib\locale'
./node_modules/@auth0/angular-jwt/fesm2015/auth0-angular-jwt.mjs - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
TypeError: Cannot create property 'message' on string 'C:\projects\my-app-capacitor\node_modules\@auth0\angular-jwt\fesm2015\auth0-angular-jwt.mjs: This application depends upon a library published using Angular version 14.3.0, which requires Angular version 14.0.0 or newer to work correctly.
Consider upgrading your application to use a more recent version of Angular.
259 | }
260 | JwtModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: JwtModule, deps: [{ token: JwtModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
> 261 | JwtModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: JwtModule });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
262 | JwtModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: JwtModule });
263 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: JwtModule, decorators: [{
264 | type: NgModule'
at run (C:\projects\my-app-capacitor\node_modules\@babel\core\lib\transformation\index.js:37:15)
at run.next (<anonymous>)
at Function.transform (C:\projects\my-app-capacitor\node_modules\@babel\core\lib\transform.js:25:41)
at transform.next (<anonymous>)
at step (C:\projects\my-app-capacitor\node_modules\gensync\index.js:261:32)
at C:\projects\my-app-capacitor\node_modules\gensync\index.js:273:13
at async.call.result.err.err (C:\projects\my-app-capacitor\node_modules\gensync\index.js:223:11)
at C:\projects\my-app-capacitor\node_modules\gensync\index.js:37:40
[ERROR] An error occurred while running subprocess ng.
type or paste code here
Package file
{
"name": "my-app",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/common": "^13.4.0",
"@angular/core": "^13.4.0",
"@angular/forms": "^13.4.0",
"@angular/platform-browser": "^13.4.0",
"@angular/platform-browser-dynamic": "^13.4.0",
"@angular/router": "^13.4.0",
"@auth0/angular-jwt": "^5.0.2",
"@awesome-cordova-plugins/app-version": "^5.41.0",
"@awesome-cordova-plugins/core": "^5.41.0",
"@awesome-cordova-plugins/globalization": "^5.41.0",
"@awesome-cordova-plugins/google-analytics": "^5.41.0",
"@awesome-cordova-plugins/in-app-browser": "^5.41.0",
"@capacitor-community/apple-sign-in": "^6.0.0",
"@capacitor-community/facebook-login": "^6.0.0",
"@capacitor-community/stripe": "^6.0.1",
"@capacitor-community/stripe-identity": "^6.0.1",
"@capacitor-community/stripe-terminal": "^6.0.1",
"@capacitor/android": "^6.0.0",
"@capacitor/app": "^6.0.0",
"@capacitor/core": "^6.0.0",
"@capacitor/haptics": "^6.0.0",
"@capacitor/ios": "^6.0.0",
"@capacitor/keyboard": "^6.0.0",
"@capacitor/push-notifications": "^6.0.0",
"@capacitor/status-bar": "^6.0.0",
"@codetrix-studio/capacitor-google-auth": "^3.4.0-rc.4",
"@ionic-native/globalization": "^5.36.0",
"@ionic-native/ionic-webview": "^5.36.0",
"@ionic-native/launch-review": "^5.36.0",
"@ionic/angular": "^6.7.4",
"@ionic/cli": "^6.20.9",
"@ionic/storage-angular": "^3.0.6",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"cordova-browser": "6.0.0",
"cordova-ios": "6.3.0",
"moment": "^2.29.3",
"moment-timezone": "^0.5.34",
"rxjs": "~6.6.0",
"tslib": "^2.4.0",
"zone.js": "^0.11.5"
},
"devDependencies": {
"@angular-devkit/build-angular": "^13.3.11",
"@angular-eslint/builder": "^13.5.0",
"@angular-eslint/eslint-plugin": "^13.5.0",
"@angular-eslint/eslint-plugin-template": "^13.5.0",
"@angular-eslint/template-parser": "^13.5.0",
"@angular/cli": "^13.3.11",
"@angular/compiler": "^13.4.0",
"@angular/compiler-cli": "^13.4.0",
"@angular/language-service": "^13.4.0",
"@capacitor/cli": "^6.0.0",
"@ionic-native/core": "^5.36.0",
"@ionic/angular-toolkit": "^4.0.0",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.20.48",
"@typescript-eslint/eslint-plugin": "4.16.1",
"@typescript-eslint/parser": "4.16.1",
"cordova-plugin-app-version": "^0.1.14",
"cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-ionic-webview": "^5.0.0",
"eslint": "^7.6.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "30.7.6",
"eslint-plugin-prefer-arrow": "1.2.2",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "^6.3.19",
"karma-chrome-launcher": "^3.1.1",
"karma-coverage": "~2.0.3",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "^4.0.2",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"typescript": "4.6.4"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-globalization": {},
"cordova-plugin-facebook-connect": {
"APP_ID": "xxxxx",
"APP_NAME": "GemarExpress SocialLogin",
"FACEBOOK_URL_SCHEME_SUFFIX": " ",
"OTHER_APP_SCHEMES": " ",
"FACEBOOK_AUTO_LOG_APP_EVENTS": "true",
"FACEBOOK_HYBRID_APP_EVENTS": "false",
"FACEBOOK_ADVERTISER_ID_COLLECTION": "true",
"FACEBOOK_ANDROID_SDK_VERSION": "11.3.0",
"FACEBOOK_IOS_SDK_VERSION": "11.1.0",
"FACEBOOK_BROWSER_SDK_VERSION": "v11.0"
},
"cordova-plugin-app-version": {}
},
"platforms": [
"browser",
"android",
"ios"
]
}
}
Ionic Info:
Ionic:
Ionic CLI : 7.2.0 (C:\tools\nvm\v18.13.0\node_modules\@ionic\cli)
Ionic Framework : @ionic/angular 6.7.4
@angular-devkit/build-angular : 13.3.11
@angular-devkit/schematics : 13.3.11
@angular/cli : 13.3.11
@ionic/angular-toolkit : 4.0.0
Capacitor:
Capacitor CLI : 6.0.0
@capacitor/android : 6.0.0
@capacitor/core : 6.0.0
@capacitor/ios : 6.0.0
Cordova:
Cordova CLI : not installed
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : not installed globally
native-run : 2.0.1
System:
Android SDK Tools : 26.1.1 (C:\Users\myuser\AppData\Local\Android\Sdk)
NodeJS : v18.13.0 (C:\Program Files\nodejs\node.exe)
npm : 8.19.3
OS : Windows 10
Please Help me!