ionic-team / ionic-v1

The repo for Ionic 1.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
193 stars 187 forks source link

$state.go error #251

Open jgw96 opened 7 years ago

jgw96 commented 7 years ago

From @thiagosjk on May 9, 2017 15:26

Ionic version: (check one with "x") [x] 1.x [ ] 2.x [ ] 3.x

I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior: I have a $state.go and it's not changing the route on iOS. On Android is working fine.

This is the error that I catch on $state.go:

TypeError: b.headers is not a function. (In 'b.headers("content-type")', 'b.headers' is undefined)

Expected behavior: Just change the route and go to the home page. I was using Android and now I'm testing on iOS. On Android is working fine.

Related code:

$state.go('app.contactlist').then(function(s) {
                                    console.log("success")
                                }, function(error) {
                                    console.log("error", error)
                                });

Other information:

I'm using ionic.bundle.js with ionic v1.3.1.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Cordova CLI: 6.4.0 
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v7.9.0
Xcode version: Xcode 8.2.1 Build version 8C1002

Copied from original issue: driftyco/ionic#11576

thiagosjk commented 7 years ago

I fixed! I was getting permission errors after install cordova-plugin-wkwebview-engine wich another package in my project requires. I installed an updated version of cordova-plugin-wkwebview-engine and now it's working.

The error was happening because I didn't have permissions to load my templates.