# History.back() error

**URL:** <https://forum.ionicframework.com/t/history-back-error/100967>\
**Category:** ionic-v3\
**Created:** [August 5, 2017, 1:36pm UTC](https://forum.ionicframework.com/t/history-back-error/100967 "2017-08-05T13:36:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnny13](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@Johnny13](https://forum.ionicframework.com/u/Johnny13)\
**Post date:** [August 5, 2017, 1:36pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/1 "2017-08-05T13:36:44Z")

</div>

When I push a new page and then return to the previous page。it will throw an error。  
 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/e/5/e5580514b833ae5d3cf6e4fce666b73700dc5211.png)

this my code:

back() {  
history.back();  
}

ionic info:  
 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/5/5/55223f67403f6c6dc8fe4c59c3649091ea8d0fec.png)

my package.json:  
“dependencies”: {  
“@angular/common”: “^4.3.3”,  
“@angular/compiler”: “^4.3.3”,  
“@angular/compiler-cli”: “^4.3.3”,  
“@angular/core”: “^4.3.3”,  
“@angular/forms”: “^4.3.3”,  
“@angular/http”: “^4.3.3”,  
“@angular/platform-browser”: “^4.3.3”,  
“@angular/platform-browser-dynamic”: “^4.3.3”,  
“@ionic-native/app-minimize”: “^4.1.0”,  
“@ionic-native/badge”: “^4.1.0”,  
“@ionic-native/camera”: “^4.1.0”,  
“@ionic-native/core”: “^4.1.0”,  
“@ionic-native/device”: “^4.1.0”,  
“@ionic-native/local-notifications”: “^4.1.0”,  
“@ionic-native/network”: “^4.1.0”,  
“@ionic-native/splash-screen”: “^4.1.0”,  
“@ionic-native/status-bar”: “^4.1.0”,  
“@ionic-native/toast”: “^4.1.0”,  
“@ionic/storage”: “2.0.1”,  
“cordova-android”: “^6.2.3”,  
“cordova-ios”: “^4.4.0”,  
“cordova-plugin-appminimize”: “^1.0.0”,  
“cordova-plugin-badge”: “^0.8.1”,  
“cordova-plugin-camera”: “^2.4.1”,  
“cordova-plugin-compat”: “^1.1.0”,  
“cordova-plugin-console”: “^1.0.5”,  
“cordova-plugin-device”: “^1.1.4”,  
“cordova-plugin-network-information”: “^1.3.3”,  
“cordova-plugin-splashscreen”: “^4.0.3”,  
“cordova-plugin-statusbar”: “^2.2.2”,  
“cordova-plugin-whitelist”: “^1.3.1”,  
“cordova-plugin-x-toast”: “^2.6.0”,  
“de.appplant.cordova.plugin.local-notification”: “^0.8.5”,  
“ionic-angular”: “^3.6.0”,  
“ionic-plugin-keyboard”: “^2.2.1”,  
“ionicons”: “3.0.0”,  
“rxjs”: “^5.4.2”,  
“sw-toolbox”: “3.6.0”,  
“zone.js”: “^0.8.16”  
},  
“devDependencies”: {  
“@ionic/app-scripts”: “^2.1.3”,  
“@ionic/cli-plugin-cordova”: “^1.6.2”,  
“@ionic/cli-plugin-ionic-angular”: “^1.4.1”,  
“ionic”: “^3.7.0”,  
“typescript”: “^2.4.2”  
}

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 5, 2017, 1:44pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/2 "2017-08-05T13:44:06Z")

</div>

> [@Johnny13](#):
>
> history.back();

What is `history`?

(I removed the mention of “ionic 3.7” from the title as this is the CLI version, which probably is not relevant to the problem)

---

<div class="post-metadata">

**Author:** ![Johnny13](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@Johnny13](https://forum.ionicframework.com/u/Johnny13)\
**Post date:** [August 5, 2017, 1:51pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/3 "2017-08-05T13:51:51Z")

</div>

window.history.back();

---

<div class="post-metadata">

**Author:** ![arnoldparge](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arnoldparge/32/111355_2.png) [@arnoldparge](https://forum.ionicframework.com/u/arnoldparge)\
**Post date:** [August 5, 2017, 1:52pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/4 "2017-08-05T13:52:42Z")

</div>

> [@Johnny13](#):
>
> history.back();

Why??  
Ionic is already an amazing thing which tracks the pages, handles the stack of the pages so when you press a back harware button you go to the previous page.

If you wish to go navigate back manually (without harware button). You can you use [pop](https://ionicframework.com/docs/api/navigation/NavController/#pop) method, it removes the page from the stack. 🙂

---

<div class="post-metadata">

**Author:** ![Johnny13](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@Johnny13](https://forum.ionicframework.com/u/Johnny13)\
**Post date:** [August 5, 2017, 2:07pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/5 "2017-08-05T14:07:53Z")

</div>

When I click the browser back button, it will throw the same error。

---

<div class="post-metadata">

**Author:** ![arnoldparge](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arnoldparge/32/111355_2.png) [@arnoldparge](https://forum.ionicframework.com/u/arnoldparge)\
**Post date:** [August 5, 2017, 2:10pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/6 "2017-08-05T14:10:46Z")

</div>

> [@Johnny13](#):
>
> browser back button

Browser is just for testing. You dont need to worry about the browser’s back button…!!

Focus on navigation in device instead.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 5, 2017, 2:15pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/7 "2017-08-05T14:15:11Z")

</div>

> [@arnoldparge](#):
>
> Browser is just for testing. You dont need to worry about the browser’s back button…!!

There are people building web apps with Ionic.

---

<div class="post-metadata">

**Author:** ![arnoldparge](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arnoldparge/32/111355_2.png) [@arnoldparge](https://forum.ionicframework.com/u/arnoldparge)\
**Post date:** [August 5, 2017, 2:19pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/8 "2017-08-05T14:19:26Z")

</div>

I think angular alone is enough for that. Ionic is Angular+Cordova and cordova is useful only in devices.

---

<div class="post-metadata">

**Author:** ![Johnny13](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@Johnny13](https://forum.ionicframework.com/u/Johnny13)\
**Post date:** [August 5, 2017, 2:26pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/9 "2017-08-05T14:26:21Z")

</div>

There was no problem with previous versions of ionic , So how can I do？

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 5, 2017, 2:30pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/10 "2017-08-05T14:30:14Z")

</div>

Ionic is much more than just Ionic+Cordova. If you only want to use Cordova, that is fine - but please don’t impress that on others, especially if they are asking for help.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 5, 2017, 2:30pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/11 "2017-08-05T14:30:39Z")

</div>

Can you please create a new project with `ionic start blank blank` and see if you can reproduce the problem there?

---

<div class="post-metadata">

**Author:** ![Johnny13](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@Johnny13](https://forum.ionicframework.com/u/Johnny13)\
**Post date:** [August 5, 2017, 3:15pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/12 "2017-08-05T15:15:51Z")

</div>

Yes, it will throw the same error。

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 5, 2017, 4:08pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/13 "2017-08-05T16:08:01Z")

</div>

No changes to the blank project and you get an error when you use the back button?  
(How do you do that with no pages to navigate to?)

---

<div class="post-metadata">

**Author:** ![Johnny13](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@Johnny13](https://forum.ionicframework.com/u/Johnny13)\
**Post date:** [August 5, 2017, 4:14pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/14 "2017-08-05T16:14:57Z")

</div>

No changes to the blank project , it will not throw an error.  
if I use **push** ,it will throw an error.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 5, 2017, 4:36pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/15 "2017-08-05T16:36:46Z")

</div>

What exactly do you change on the project to get an error?

---

<div class="post-metadata">

**Author:** ![Johnny13](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@Johnny13](https://forum.ionicframework.com/u/Johnny13)\
**Post date:** [August 5, 2017, 4:41pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/16 "2017-08-05T16:41:32Z")

</div>

I just added a new page and **push** it.  
 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/1/0/106ec53dcef9440386d1a90560864a9367437a98.png)

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 5, 2017, 4:47pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/17 "2017-08-05T16:47:52Z")

</div>

What error does it give you?

(Do you really want help? Then please provide the information that could be needed to help you. At least a description what is breaking how should not be to surprising)

---

<div class="post-metadata">

**Author:** ![Johnny13](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@Johnny13](https://forum.ionicframework.com/u/Johnny13)\
**Post date:** [August 5, 2017, 5:01pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/18 "2017-08-05T17:01:22Z")

</div>

a same error .When I click the browser back button  
 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/3/c/3c3c6996594828b1ae8ea110c230f85e5e75850e.png)

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/c/6/c68a15a5c65c2cec04ebc81a2d3c301304f41977.png)

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [August 5, 2017, 6:23pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/19 "2017-08-05T18:23:31Z")

</div>

Upload the project to Github please and post the link.

---

<div class="post-metadata">

**Author:** ![Johnny13](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@Johnny13](https://forum.ionicframework.com/u/Johnny13)\
**Post date:** [August 5, 2017, 7:21pm UTC](https://forum.ionicframework.com/t/history-back-error/100967/20 "2017-08-05T19:21:21Z")

</div>

Thanks! This is the link.

> **[jybulid/ioinc-testBank](https://github.com/jybulid/ioinc-testBank)**
>
> Contribute to ioinc-testBank development by creating an account on GitHub.

[Next page](https://forum.ionicframework.com/t/history-back-error/100967.md?page=2)
