GithubHelp home page GithubHelp logo

Safari fatal error about nprogress HOT 9 CLOSED

vue-bulma avatar vue-bulma commented on June 23, 2024
Safari fatal error

from nprogress.

Comments (9)

fundon avatar fundon commented on June 23, 2024

Could you add an example for that?

from nprogress.

wouterNL avatar wouterNL commented on June 23, 2024
import nprogress from 'nprogress'

function install (Vue) {
  if (this.installed) return
  this.installed = true

  Object.defineProperty(Vue.prototype, '$nprogress', {
    get: function get () { return this.$root._nprogress }
  })

  Vue.mixin({
    beforeCreate: function beforeEach () {
      const np = this.$options.nprogress
      if (np) {
        this._nprogress = np
        np.init(this)

        if (Vue.http) {
          Vue.http.interceptors.push(function (request, next) {
            np.inc(0.2)
            next(function (response) {
              np.done()
              return response
            })
          })
        }

        const router = this.$options.router
        if (router) {
          router.beforeEach(function (route, redirect, next) {
            np.start()
            next()
          })
          router.afterEach(function () {
            np.done()
          })
        }
      }
    }
  })
}

function NProgress (options) {
  this.app = null
  this.configure(options || {})
}

NProgress.prototype.init = function (app) {
  this.app = app
}

NProgress.install = install

Object.setPrototypeOf(NProgress.prototype, nprogress)

export default NProgress

To:

import nprogress from 'nprogress'

function install (Vue) {
  if (this.installed) return
  this.installed = true

  Object.defineProperty(Vue.prototype, '$nprogress', {
    get: function get () { return this.$root._nprogress }
  })

  Vue.mixin({
    beforeCreate: function beforeEach () {
      var np = this.$options.nprogress
      if (np) {
        this._nprogress = np
        np.init(this)

        if (Vue.http) {
          Vue.http.interceptors.push(function (request, next) {
            np.inc(0.2)
            next(function (response) {
              np.done()
              return response
            })
          })
        }

        var router = this.$options.router
        if (router) {
          router.beforeEach(function (route, redirect, next) {
            np.start()
            next()
          })
          router.afterEach(function () {
            np.done()
          })
        }
      }
    }
  })
}

function NProgress (options) {
  this.app = null
  this.configure(options || {})
}

NProgress.prototype.init = function (app) {
  this.app = app
}

NProgress.install = install

Object.setPrototypeOf(NProgress.prototype, nprogress)

export default NProgress

The reason this is not working is because the node-modules is not getting pulled through the web-pack compiler to convert ES6 to ES5.

from nprogress.

wouterNL avatar wouterNL commented on June 23, 2024

I just checked you other project: Vue Admin
That one is having the same problem in Safari.

from nprogress.

fundon avatar fundon commented on June 23, 2024

Which version is your safari?

from nprogress.

wouterNL avatar wouterNL commented on June 23, 2024

Version 9.1.2

from nprogress.

fundon avatar fundon commented on June 23, 2024

Version 10.0.1 (12602.2.14.0.1) is ok.

Could you post a PR? 😀

from nprogress.

wouterNL avatar wouterNL commented on June 23, 2024

May I ask why you don't have any minified versions of your plugins, that are pulled through web pack? That way you also solve the problem for older browsers. Because IE9> also doesn't support it.

from nprogress.

fundon avatar fundon commented on June 23, 2024

I think this issue will be fixed when building source codes on production with webpack.

from nprogress.

fundon avatar fundon commented on June 23, 2024

@wouterNL Landed in 0c6a4aa.

from nprogress.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.