Code Monkey home page Code Monkey logo

Comments (6)

silverbackdan avatar silverbackdan commented on May 18, 2024

Just moved the interceptor to directly before the get request within asyncData and that doesn't work either strangely enough - also if I use axios directly - I don't think this can be an issue with this plugin after seeing that.

from legacy-modules.

silverbackdan avatar silverbackdan commented on May 18, 2024

Actually, this is an error in the plugin.

// Don't throw unhandled promises in SSR context
    return this.app._nuxt.error.call({$options: this.app}, {
      message: error.message,
      statusCode: error.statusCode
    })

Because in SSR the error isn't passed I can't catch it and do whatever I want. How can we get around this one?

from legacy-modules.

pi0 avatar pi0 commented on May 18, 2024

@silverbackdan In latest commit, I've entirely removed that auto error handling logic. Would be nice having your comments on it before next release :)

from legacy-modules.

silverbackdan avatar silverbackdan commented on May 18, 2024

@pi0 Ooo I quite like that :) I didn't know if there was a reason why the promise wasn't rejected on server-side before but it is nice still having the standardised status and message. It'd certainly work for my needs still!

from legacy-modules.

pi0 avatar pi0 commented on May 18, 2024

Thanks for your review. Actually i think the problem with handled promises should be fixed on Nuxt itself because both fetch and asyncData are being called before actual Vue rendering.

from legacy-modules.

silverbackdan avatar silverbackdan commented on May 18, 2024

That's much better, I'll update to the latest commit tomorrow morning. Thanks for taking the time on this module.

from legacy-modules.

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.