question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

forceUpdate does not work with axios 0.19

See original GitHub issue

I’m using request options to force axios-extensions to update cache entries when needed.

This has been working fine with axios 0.18.0 (and 0.18.1) but when I recently updated to 0.19.0 I noticed that forceUpdate does not have effect anymore. Data is still returned from cache.

package.json:

    "axios": "^0.19.0",
    "axios-extensions": "^3.0.6",

Code:

const requestOptions = {
  params: {
    _format: 'json',
  },
  forceUpdate: cacheIsBypassed,
};
const {data} = await cachedAxios.get(requestUrl, requestOptions);

For now the resolution was reverting back to 0.18.1 but for going forward it would be good to make axios-extensions to work fully with axios 0.19 too.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kuitoscommented, Jun 16, 2019

Seems that was a bug/breaking change with axios v0.19.0, see https://github.com/axios/axios/pull/2207

Maybe I should add a comment on README about this before the bug fixed by axios.

0reactions
insanity54commented, Feb 21, 2020

I understand, thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React setState in an axios call after switching pages quickly
Flow-> Mounted->Axios call->Unmount->Mount->Response received. In my case while receiving response the component is mounted but remember as ...
Read more >
React setState in an axios call after switching pages quickly ...
Why does my Auth.currentAuthenticatedUser() method return updated state after I reload and not when the useEffect's dependency runs (or login/logout)? · How to ......
Read more >
React (forked) - StackBlitz
Starter project for React apps that exports to the create-react-app CLI.
Read more >
its instance type is not a valid jsx element - You.com | The search ...
It seems like @types/react problem with multiple versions. ... context, setState, forceUpdate, and 3 more.ts(2 `import { HelmetProvider } from ...
Read more >
chunk-vendors.0323267d.js.map
node_modules/_axios@0.19.2@axios/lib/helpers/parseHeaders.js","webpack:///. ... node_modules/_core-js@3.6.4@core-js/internals/object-property-is-enumerable.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found