Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onUploadProgress on $fetch #27079

Closed
a7med-hussien opened this issue May 7, 2024 · 3 comments
Closed

onUploadProgress on $fetch #27079

a7med-hussien opened this issue May 7, 2024 · 3 comments

Comments

@a7med-hussien
Copy link

a7med-hussien commented May 7, 2024

Environment


  • Operating System: Windows_NT
  • Node Version: v20.12.2
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: npm@10.1.0
  • Builder: -
  • User Config: app, routeRules, runtimeConfig, css, colorMode, googleFonts, ssr, devtools, ignore, modules, build, dayjs, auth
  • Runtime Modules: @nuxt/ui@2.15.2, @vueuse/nuxt@10.9.0, @nuxt/image@1.6.0, @pinia/nuxt@0.5.1, @sidebase/nuxt-auth@0.6.7, @pinia-plugin-persistedstate/nuxt@1.2.0, @nuxtjs/device@3.1.1, @nuxtjs/google-fonts@3.2.0, dayjs-nuxt@2.1.9, @nuxtjs/fontaine@0.4.1, @formkit/auto-animate/nuxt@0.8.2, @nuxt/test-utils/module@3.12.1, floating-vue/nuxt, @samk-dev/nuxt-vcalendar@1.0.3
  • Build Modules: -

Reproduction

upload(files) {
  const config = {
    onUploadProgress: function(progressEvent) {
      const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
      console.log(percentCompleted)
    }
  }

  let data = new FormData()
  data.append('file', files[0])

  $fetch(url, {
    method: 'POST',
    body: data,
    config
  }).then(res => console.log({ res })).catch(err => console.log({ err }))}

Describe the bug

i can't find onUploadProgress in $fetch module
we used to use it in axios to enable us making a progress bar while uploading images

Additional context

No response

Logs

No response

@xjccc
Copy link
Contributor

xjccc commented May 7, 2024

unjs/ofetch#45

It's not support now...

@manniL
Copy link
Member

manniL commented May 7, 2024

Closing in favor of unjs/ofetch#45. Should work in chrome only at the moment with a bit of hand work.

@manniL manniL closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
@bbhxwl
Copy link

bbhxwl commented Jul 6, 2024

Closing in favor of unjs/ofetch#45. Should work in chrome only at the moment with a bit of hand work.

Is it not supported yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants