Coder Social home page Coder Social logo

Comments (7)

GunsStarR avatar GunsStarR commented on September 17, 2024

Hi @lukvermeulen! Facing the same issue with send XHR through superagent. Did you find solution? Or used something else?

from storybook-addon-mock.

lukvermeulen avatar lukvermeulen commented on September 17, 2024

Hey @GunsStarR, I ended up using "Mock Service Worker", after following this article. It works quite well for me.

from storybook-addon-mock.

nutboltu avatar nutboltu commented on September 17, 2024

@lukvermeulen I tried to run swr with storybook-addon-mock and it works properly. I have used their basic example for testing.

Looking at your code, can you tell me which type of client is this? is it going to call a fetch or XHR request?

const channelsFetcher = () => {
  return client
    .service("channels")
    .find()
    .then((res) => {
      return res.data;
    });
};

from storybook-addon-mock.

nutboltu avatar nutboltu commented on September 17, 2024

@GunsStarR it's confirmed that there's a bug in the package which breaks the superagent. You will get the fix in the upcoming release.

from storybook-addon-mock.

nutboltu avatar nutboltu commented on September 17, 2024

@GunsStarR this fix is released in version 2.4.0. Can you please check?

from storybook-addon-mock.

lukvermeulen avatar lukvermeulen commented on September 17, 2024

Hi @nutboltu, my client is configured to use native window.fetch

from storybook-addon-mock.

pjaws avatar pjaws commented on September 17, 2024

I'm using swr along with axios in a custom fetcher and also experiencing issues. I posted a detailed comment in another issue about relative URLs here.

I'm using version 2.4.1.

from storybook-addon-mock.

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.