Code Monkey home page Code Monkey logo

Comments (8)

Auspicus avatar Auspicus commented on September 18, 2024 1

@gkatsanos In the meantime you can rename your new middleware to "errors" and this should fix the error you're seeing. We will have a fix for this out in the next few hours.

from devour-client.

gkatsanos avatar gkatsanos commented on September 18, 2024

Seems that this broke from "2.0.27", to "2.1.0"

from devour-client.

Auspicus avatar Auspicus commented on September 18, 2024

@kevincoenegrachts worked on the PR for this. He'd have more insight.

from devour-client.

Auspicus avatar Auspicus commented on September 18, 2024

Looks like we are checking to see if the new middleware name exists in the middleware stack rather than the middleware we would be replacing... There's a debate to be had here about whether this function should keep the middleware it's replacing's name. For backwards compatibility it's necessary that we only check the middleware we're replacing's name.

This:

https://github.com/twg/devour/blob/master/src/index.js#L282-L285

Becomes:

replaceMiddleware (middlewareName, newMiddleware) {
    if (!this.middlewareExists(middlewareName)) {
      Logger.error('The middleware ' + middlewareName + ' does not exists')
      return
    }

    if (this.middlewareExists(newMiddleware.name)) {
      Logger.error('The middleware ' + newMiddleware.name + ' already exists')
      return
    }

    let index = _findIndex(this.middleware, ['name', middlewareName])
    this.middleware[index] = newMiddleware
  }

This should ensure backwards compat.

from devour-client.

auvipy avatar auvipy commented on September 18, 2024

did this got fixed?

from devour-client.

gkatsanos avatar gkatsanos commented on September 18, 2024

@Auspicus Did this get fixed?
I was also wondering where is devour 2.x ? (I saw it mentioned in the README but its nowhere to be found)

from devour-client.

Auspicus avatar Auspicus commented on September 18, 2024

This still needs to be fixed. Happy to merge a PR for this if anyone has the time.

from devour-client.

tijn avatar tijn commented on September 18, 2024

@Auspicus I made a PR that will fix this: #206 . Merge at will 😄

from devour-client.

Related Issues (20)

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.