Nuxt.js: A problem of nuxt in IE9

Created on 16 Nov 2017  ·  9Comments  ·  Source: nuxt/nuxt.js

When I start to run my nuxt project in ie9,I got a problem. console say "[nuxt] Error while initializing appTypeError: 对象不支持“replaceState”属性或方法", it seems not support replaceState.
Is anyone can tell me how to fix it ? !

PS: I have already installed babel-polyfill, and ie9 can run the project few days, but today the problem was appear, even I didn't have change anything! It sounds unbelievable...but it happen

This question is available on Nuxt.js community (#c1886)
question

Most helpful comment

@huanyu I resolved by this:
window.history.replaceState = window.history.replaceState || function(){};

All 9 comments

IE9 doesn't support History API, use hash mode or fallback.

//nuxt.config.js
module.exports = {
  router: {
    mode: 'hash',
    // or
    fallback: true
  }
}

@clarkdo vue-router had solved this problem on v3.0.1 [https://github.com/vuejs/vue-router/tree/v3.0.1] . but nuxtjs is use to the old version v2.7.0 . When will the next version be updated to solve this problem in IE9?

Please refer https://github.com/nuxt/nuxt.js/issues/2142, we're really work hard on the new release. 😸

@djune i have tried upgrade vue-router to v3.0.1, and still got that error.

the way to upgrade it is just delete the package in node_modules and reinstall it, and upgrade other vue packages

@huanyu I resolved by this:
window.history.replaceState = window.history.replaceState || function(){};

@clarkdo Thank you. It helped me a lot. Fallback is a great way to do it.

@djune It helped me a lot in this way

@clarkdo
_7 _whcw_w6 15odm 8io
wyun if2rc 0z4 y8
vi l8 fgs gsztvteo5pmje

Do you know what the problem is?

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

surmon-china picture surmon-china  ·  3Comments

mattdharmon picture mattdharmon  ·  3Comments

shyamchandranmec picture shyamchandranmec  ·  3Comments

bimohxh picture bimohxh  ·  3Comments

vadimsg picture vadimsg  ·  3Comments