It works
imports: [
IonicModule.forRoot(MyApp),
BrowserModule
]
Finally.
Thanks!!!
It works
imports: [
IonicModule.forRoot(MyApp),
BrowserModule
]
Finally.
Thanks!!!
Donât forget to also import HttpModule
if you are using Http.
Runtime Error
HttpModule is not defined
BTW @rapropos do you know what could happen with this error
ionic run ios --device
** BUILD SUCCEEDED **
xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH
Error: Error code 72 for command: xcrun with args: -sdk,iphoneos,PackageApplication,-v,/.../ionic-new/platforms/ios/build/device/ionic-new.app,-o,/.../ionic-new/platforms/ios/build/device/ionic-new.ipa
Blind guess, but maybe you havenât installed ios-deploy or whatever that thing is called. I never use ionic run
, so not sure. I always just run out of Xcode.
Itâs installed
$ ionic info
Your system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.0
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.10.2
Xcode version: Xcode 8.3 Build version 8E162
I read that maybe it could be compatibility with Xcode 8.3 and cordova, but not idea
What version of cordova-ios do you have?
$ ionic platform ls
If itâs older than 4.3, perhaps this PR fixed it, and upgrading your platform will fix things.
$ ionic platform ls
Installed platforms:
ios 4.1.1
This is probably happens on upgrading your previous Ionic Project to its Latest Version :
To solve this,
Add BrowserModule
in app.module.ts file.
import BrowserModule
first:
import { BrowserModule } from â@angular/platform-browserâ;
Update imports inside @NgModule
(i.e. inject BrowserModule
here):
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
Remember That: If you are using
Http
, import theHttpModule
in your app/app.module.ts file:
import { HttpModule } from â@angular/httpâ;
Also add
HttpModule
into imports under@NgModule
â All the best
where did you add this?
imports: [
IonicModule.forRoot(MyApp),
BrowserModule
]
app.module.ts i guess.
You have to do this for iOnic 3
Already add this
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
but I have this error now
Runtime Error
Uncaught (in promise): ReferenceError: WikitudePlugin is not defined
anyone?
import { BrowserModule } from â@angular//platform-browserâ;
import { HttpModule } from â@angular/httpâ;
imports: [
BrowserModule,
HttpModule,
IonicModule.forRoot(MyApp)
],
BrowserModule is missing in your app. you need to import browser module
@rapropos - just an off topic question but an important one for meâŚ
How did you figure out that it is related to BrowserModule?
Your knowledge and patience to help everybody is awesome!! A true Guru!
Thanks!
The comment suggesting that OP check the upgrade guide made me think it might have been something that changed between versions. I used GitHubâs search feature to look for ApplicationInitStatus
in both the Ionic and Angular repositories. Found it in Angularâs core, thought of the need for importing BrowserModule
being a relatively new requirement, opened up my trusty sandbox project, took the BrowserModule
import out of its app module, tried to run, and replicated OPâs error.
I tried to do follow the same but even though I have imported BrowserModule and included in
imports: [
IonicModule.forRoot(MyApp),BrowserModule
],
still it gives me the same error.
Am I missing something.
Followed the Ionic 3 migration guide, added BrowserModule as said in multiple replies.
At first I did not see any changes.
Then I remembered that I had uncommented the service-worker, and so when I updated the page, it was reloading with the same error from the service-workerâs cache⌠so I hit hard reload and finally saw my app fixed!
Hope this will help someone.