Coder Social home page Coder Social logo

Progress event arguments bug about upchunk HOT 9 CLOSED

muxinc avatar muxinc commented on May 19, 2024
Progress event arguments bug

from upchunk.

Comments (9)

dylanjha avatar dylanjha commented on May 19, 2024

@BlueBazze thanks for opening -- can you try the console.log without JSON.stringify? Update to this:

this.uploader.on('progress', (progress) => {
  console.log(progress)
})

from upchunk.

BlueBazze avatar BlueBazze commented on May 19, 2024

@dylanjha Thanks for the swift response.
The outcome is the same. Except now theres a little arrow i can click to expand the object tree.
Still only contains a single value "IsTrusted": false

from upchunk.

BlueBazze avatar BlueBazze commented on May 19, 2024

If i try to render this.uploader.progress?.IsTrusted in the component, it will just render false

from upchunk.

mmcc avatar mmcc commented on May 19, 2024

You're not finding IsTrusted in the UpChunk source because that key/value is coming from the native Event implementation. Just say that to say, that's a bit of a red herring here I think, all that means is that the event didn't come from an explicit user action.

Any chance you can put this reduced test case somewhere we can play with it like JSFiddle or Codesandbox?

from upchunk.

BlueBazze avatar BlueBazze commented on May 19, 2024

https://codesandbox.io/p/sandbox/frosty-resonance-dzwhkc

All you need to do is insert an upload url on line 54 in components/UploadComponent.vue

from upchunk.

mmcc avatar mmcc commented on May 19, 2024

Ugh I'm chasing down what in the world is going on with this import mess, because I'm running into that original thing you mentioned as a footnote re: import errors.

That being said, while I look into that, if you have an environment where this is working, the detail value is going to be what you want, didn't notice that missing in your examples initially. Can you try logging that and letting us know what you see?

this.uploader.on('progress', (progress) => {
  console.log(progress.detail)
  this.upload.progress = progress
})

from upchunk.

BlueBazze avatar BlueBazze commented on May 19, 2024

Nuxt is heavily biased towards esm. The import import * as UpChunk from '@mux/upchunk/dist/upchunk' or with .mjs should work

I didnt actually look at the prototype object before, but the value seems to be present as you described.
image
Code

        this.uploader.on('progress', (progress) => {
          console.log(JSON.stringify(progress), { progress })
          this.upload.progress = progress.detail
        })

image

from upchunk.

mmcc avatar mmcc commented on May 19, 2024

Great! Going to close this one, and #88 is where we'll continue to push on the ESM work.

from upchunk.

BlueBazze avatar BlueBazze commented on May 19, 2024

Thanks for your help

from upchunk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.