https://codesandbox.io/s/zx50vm1jql
Go to link
Slow down network (either delay 10s or change profile to 1k/sec up/down)
notice the second you click About button, the progress bar shows, even though throttle is set to 5000
Per documentation, progress bar shouldn't show until throttle is expired
Progress bar is shown right away
in your reproduction link, you should replace 'thottle' to 'throttle'
LOL, I guess it was my turn to be 'that guy' ... Fixed, problem still remains (yes I restarted the sandbox & yes it was the right syntax locally when we found the problem).. @manniL
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
ping @manniL
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
Can't repro in Firefox :thinking:
Grr, now I can't repro either in the sandbox (I was able to repro before dozens of times). I'll check local and verify everything is ok now.
Local dev looks fine now too. I assume this was fixed in a later version or something.
@hecktarzuli I forked your sandbox and added a real http request in the fetch so it would do an actual request and take some time to resolve.
As you can see I set the throttle to 1s and it still flashes between navigating.
https://codesandbox.io/s/codesandbox-nuxt-loading-throttle-issue-yhkp3~~
@manniL could you review again?
@hecktarzuli can you re-open if you confirm?
I can confirm this issue does exist but it has nothing to do with Nuxt itself, it's only when you use the Axios module.
This is a knowns issue and has an open pull request.
https://github.com/nuxt-community/axios-module/pull/247
Yeah this is weird. In my local dev, setting throttle to 20s still shows the progress bar immediately. I don't know how this would be anything other than nuxt's fault. It's their component that should be abiding by the nuxt.config.js
@hecktarzuli no the @nuxtjs/axios module calls the set method on the loading component that immediately shows the loading bar. This is by design.
The pull request I referenced is their to discus if the @nuxtjs/axios module should change its behavior so it respects the throttle configuration set by the user.
That abstraction is pretty messy. IMHO, Nuxt should expose a loading object that webpack, axios and other junk can add and remove stuff from as things are loaded. Then the only thing the loading component would need to do is decide how to render that abstraction over time.
In other words, the axios plugin should NOT be playing with the loading component, what it should be doing it just telling nuxt its loading X many resources and remove them when they are done loading. (@manniL)