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.

progress: false does not work in version 5.5.3

See original GitHub issue

Version

v5.5.3

Reproduction link

https://codesandbox.io/s/8n6z6z30j8

Steps to reproduce

Add progress: false in request config:

this.$axios.get('URL', { progress: false });
this.$axios.post('URL', { data: 'data' }, { progress: false });

What is expected ?

progress bar is not displayed

What is actually happening?

Progress bar displayed for all types of requests (get, post, patch, delete)

Additional comments?

in version 5.3.6 it works correctly

<div align="right">This bug report is available on Nuxt community (#c255)</div>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:23
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
daniluk4000commented, Aug 20, 2019

Still not working in 5.6.0

8reactions
delanoflipsecommented, Jul 4, 2019

I did some digging and found that this might indeed be the result of an update in axios. But more in the sense that it shouldn’t have worked in earlier versions of this module.

When doing any axios request, axios creates a generic config file to create a request (see: https://github.com/axios/axios/blob/master/lib/core/mergeConfig.js)

It does not include the progress key. The axios onRequest hook that this module uses (see: https://github.com/nuxt-community/axios-module/blob/master/lib/plugin.js, line 108), expects that it does.

Creating a plugin as such:

$axios.onRequest(config => {
  console.log(config.progress);
});

Shows that it is always undefined (as could be expected), so the test config && config.progress === false always fails.

I was unable to find a way to pass custom data to the axios config as of yet. For now this ugly fix worked:

// https://github.com/nuxt-community/axios-module/blob/master/lib/plugin.js, line 108
axios.onRequest(config => {
  if (config && config.progress === false) {
    return;
  }

  if (config && config.headers && config.headers.__show_no_progress__ === true) {
    delete config.headers.__show_no_progress__;
    return;
  }

  currentRequests++;
});

// works with
$axios.$post(url, payload, { headers: { __show_no_progress__: true } });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Site kit not triggering on website - WordPress.org
I have set up Google site kit and successfully linked it to my google analytics and search console. However, when testing whether the...
Read more >
AOS Upgrade or CVM Memory Upgrade Stalls on VMware ...
In some cases, the script fails to re-configure the Controller VM, causing the upgrade process to stall. Similar issues can occur when upgrading ......
Read more >
Issues Fixed in Cloudera Manager 5 | 5.x
In Cloudera Manager, host installation and upgrade does not work when using key-based ... Cloudera recommends that you upgrade to version 5.5.3 or...
Read more >
V-Ray 5 - V-Ray for Revit - Chaos Help - Chaos Docs
V -Ray Interactive. Wrong replacements of linked file materials when Merge Identical is on; Revit family changes are not reflected to the ...
Read more >
Npm Error - No matching version found for - Stack Overflow
Same problem now after npm install -g ionic@latest which takes it up to v.3.12.0 ... npm complains that there "is no matching version...
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