Skip to content
Discussion options

You must be logged in to vote

It's because with multiple version your bundler will include two different versions of axios on the same page, each are completely different instances and why interceptors don't work

If using webpack add

  resolve: {
    alias: {
    //...
      axios: path.resolve('node_modules/axios/dist/axios.js'),
    },
  },

And then you can use whatever version you like, only one will be bundled

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@grantholle
Comment options

Comment options

You must be logged in to vote
5 replies
@citricguy
Comment options

@grantholle
Comment options

@citricguy
Comment options

@Tofandel
Comment options

@citricguy
Comment options

Answer selected by grantholle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants