Closed SeanStayn closed 5 years ago
Try updating typescript to 2.9 or newer
The update to version 2.9.2 solves the problem, but now I get the following warning:
npm WARN @angular/compiler-cli@5.2.11 requires a peer of typescript@>=2.4.2 <2.7 but none is installed. You must install peer dependencies yourself.
How can I solve this warning? I use Ionic 3 and with it angular 5. Is it okay to update angular to version 6, while using Ionic 3?
Is it just a warning or does something break? If everything works just ignore it. The example app uses compiler-cli 5.0.1 and it works fine, but I didn’t check it it shows the warning. No idea about updating to angular 6, sorry
thank you so much! :) happy weekend.
Please I need help on this
I use Visual Studio Code (VSCode) and chrome. I had the same issue, and never solved it. However, I've found that it compiles fine when I just save my code in VSCode again and again and so on! BTW I have no idea why it works if someone share us why?
@jabiinfante I updated to 2.9.2 but now when I build in android with "ionic build --prod" shows me error: Cannot find module “.”
Have you tried updating @ionic/app-scripts to latest?
Still not working. The version to updated is 3.2.3 because the latest show this error: https://forum.ionicframework.com/t/cannot-find-type-definition-file-for-types/164794 With "ionic build" everything it is ok
then you should report it on the ionic repo so it can be fixed (first check if somebody already did)
@edgarnsr Had same problem. If I update typescript to 2.9.2 I get the same problem when running ionic build --prod. According to their Github the problem is only resolved if using version 2.7.1 of typescript which does not work with Capacitor...
Hi,
I am getting the same problem on running ionic build. I have updated to typescript to 2.9.2 and @ionic/app-scripts : 3.2.3.
What else can i do?
Ionic Info:
ionic (Ionic CLI) : 4.10.3 (/usr/local/lib/node_modules/ionic) Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.2.3
Capacitor:
capacitor (Capacitor CLI) : 1.1.0 @capacitor/core : 1.1.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) Cordova Platforms : android 6.3.0, ios 4.5.5 Cordova Plugins : no whitelisted plugins (13 plugins total)
System:
ios-deploy : 2.0.0 NodeJS : v8.10.0 (/usr/local/bin/node) npm : 6.4.1 OS : macOS High Sierra Xcode : Xcode 10.1 Build version 10B61
Error : [18:03:46] typescript: node_modules/@capacitor/core/dist/esm/global.d.ts, line: 3 Type expected.
L2: declare var Capacitor: _Capacitor;
L3: declare const Plugins: import("./core-plugin-definitions").PluginRegistry;
L4: export { Capacitor, Plugins };
[18:03:46] typescript: node_modules/@capacitor/core/dist/esm/global.d.ts, line: 3 Property 'PluginRegistry' does not exist on type 'Promise<typeof "/Users/Mobility/Documents/Madhulika/Capacitor/Passman Capacitor/node_modules/@cap...'.
L2: declare var Capacitor: _Capacitor;
L3: declare const Plugins: import("./core-plugin-definitions").PluginRegistry;
L4: export { Capacitor, Plugins };
[18:03:46] ionic-app-script task: "build"
[18:03:46] Error: Failed to transpile program
Error: Failed to transpile program
at new BuildError (/Users/Mobility/Documents/Madhulika/Capacitor/Passman Capacitor/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
at /Users/Mobility/Documents/Madhulika/Capacitor/Passman Capacitor/node_modules/@ionic/app-scripts/dist/transpile.js:159:20
at new Promise (
ionic-app-scripts build exited with exit code 1.
i used
ionic build --optimizejs --minifycss --minifyjs for now till they fix this issue
Updating to typescript 2.9.2 worked fine for me. Using angular 5.0.0 & ionic-angular 3.9.5
Updating to typescript 2.9.2 worked fine for me. Using angular 5.0.0 & ionic-angular 3.9.5
can we see your package.json
{
"name": "online-site",
"version": "2.7.0",
"description": "An Ionic project",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": ""
},
"scripts": {
"clean": "ionic-app-scripts clean",
"dev": "ionic serve",
"build": "ionic-app-scripts build && npm run generate:cache-manifest && node ./build/add-version.js",
"firebase": "MY_ENV=firebase npm run build --prod && firebase deploy",
"generate:cache-manifest": "node build/workbox.js",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve",
"lint": "ionic-app-scripts lint",
"app:serve": "MY_ENV=app ionic-app-scripts serve",
"app:build": "MY_ENV=app ionic-app-scripts build && cap copy && cap open ios"
},
"dependencies": {
"@angular/common": "5.0.0",
"@angular/compiler": "5.0.0",
"@angular/compiler-cli": "5.0.0",
"@angular/core": "5.0.0",
"@angular/forms": "5.0.0",
"@angular/http": "5.0.0",
"@angular/platform-browser": "5.0.0",
"@angular/platform-browser-dynamic": "5.0.0",
"@capacitor/cli": "^1.1.0",
"@capacitor/core": "^1.1.0",
"@capacitor/ios": "^1.1.0",
"@ionic/storage": "2.1.3",
"angular2-jwt": "^0.2.3",
"angularfire2": "^4.0.0-rc.1",
"firebase": "^3.9.0",
"font-awesome": "^4.7.0",
"ionic-angular": "^3.9.5",
"ionicons": "3.0.0",
"lodash.find": "^4.6.0",
"lodash.findindex": "^4.6.0",
"ng-lazyload-image": "^3.2.2",
"ng2-select": "^1.2.0",
"ng2-validation": "^4.2.0",
"ngx-sharebuttons": "^3.0.0",
"promise-polyfill": "6.0.2",
"rxjs": "5.5.2",
"socket.io-client": "^2.0.3",
"sw-toolbox": "3.4.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "^3.1.8",
"@types/node": "^10.5.0",
"@types/socket.io-client": "^1.4.32",
"firebase-tools": "^6.6.0",
"git-rev-sync": "^1.12.0",
"typescript": "2.9.2",
"workbox-build": "^2.0.1"
},
"config": {
"ionic_sass": "./config/sass.js",
"ionic_copy": "./config/copy.js",
"ionic_bundler": "webpack",
"ionic_source_map": "source-map",
"ionic_webpack": "./config/webpack.config.js"
},
"cordova": {
"platforms": [
"android",
"ios"
],
"plugins": {
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {}
}
}
}
capacitor build and the app is running fine not blank page on the app load for android or ios??
I only get blank page when I use the -prod flag, other than that it runs fine
I only get blank page when I use the -prod flag, other than that it runs fine
Thats what am saying --prod flag give serious error so rather than using it i suggested
ionic build --optimizejs --minifycss --minifyjs to ensure your javascript and css are minified as they would be on --prod been added just only --aot that is called during --prod build is not used cause I figured that was what was causing the build failure
I only get blank page when I use the -prod flag, other than that it runs fine
Thats what am saying --prod flag give serious error so rather than using it i suggested
ionic build --optimizejs --minifycss --minifyjs to ensure your javascript and css are minified as they would be on --prod been added just only --aot that is called during --prod build is not used cause I figured that was what was causing the build failure
Ahh sorry, missed that part, good advice then!
I only get blank page when I use the -prod flag, other than that it runs fine
Thats what am saying --prod flag give serious error so rather than using it i suggested ionic build --optimizejs --minifycss --minifyjs to ensure your javascript and css are minified as they would be on --prod been added just only --aot that is called during --prod build is not used cause I figured that was what was causing the build failure
Ahh sorry, missed that part, good advice then!
We are all here to learn if you have something better I would rush to use it. I have about three apps that is currently not release because of this issue. @ionic-team please fix this issue I am on my kneels its very important. Cant a backward fix be done to the core capacitor app to solve this issue.
Did you find any fix for this issue @Kaoschuks ? I'm in the same situation as you...
Try updating typescript to 2.9 or newer
Hey there, I am having same issue. I updated TS to 2.9.2 with app-script 3.2.2 and ionic cli 3.20, but still having the same error. It is like a nightmare. I need help on this.
In Plugins -> global.d.ts This work for me
import { Capacitor as _Capacitor } from './definitions'; import * as _Plugins from "./core-plugin-definitions"; declare const Capacitor: _Capacitor;
declare const Plugins: _Plugins.PluginRegistry; export { Capacitor, Plugins };
Thanks @CarlosFJ its works for me thanks man you save my day.
Other solution: upgrade your typescript version 3.7.2
Thanks @CarlosFJ It worked for me.
i am facing same issue with capacitor 3, any solution ?
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Description of the problem: I get a transpile error after import capacitor/core in the app.component.ts
Error:
Affected platform
OS of the development machine
Other information: package.json file:
Capacitor version: 1.0.0-beta.25
node version: 10.15.3
npm version: 6.4.1
Steps to reproduce:
Fully ionic info:
Ionic:
ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic) Ionic Framework : ionic-angular 3.9.5 @ionic/app-scripts : 3.2.2
Capacitor:
capacitor (Capacitor CLI) : 1.0.0-beta.25 @capacitor/core : 1.0.0-beta.25
System:
NodeJS : v10.15.3 (/usr/local/bin/node) npm : 6.4.1 OS : macOS High Sierra