GithubHelp home page GithubHelp logo

Comments (21)

troyer avatar troyer commented on August 26, 2024 1

I'm having the same issue with Nuxt v2.15.8
TypeError: _mux_upchunk__WEBPACK_IMPORTED_MODULE_16__.createUpload is not a function

It happened to me with version 2.3.0, 2.3.1 and 2.6.0

from upchunk.

gkatsev avatar gkatsev commented on August 26, 2024 1

hey, can someone post exactly how they're using UpChunk?

Locally, I tried the following and can get a not a function error in only one of the cases with upchunk 2.3.1 and 2.6.0 using webpack 5 and webpack 4:

import { createUpload } from '@mux/upchunk';
console.log(createUpload) // createUpload

import * as UpChunk from '@mux/upchunk';
console.log(UpChunk.createUpload) // createUpload

import { UpChunk, createUpload } from '@mux/upchunk';
console.log(UpChunk.createUpload) // nothing
console.log(createUpload) // createUpload

from upchunk.

andrewcmyk avatar andrewcmyk commented on August 26, 2024 1

In my environment, I had to change:

import * as UpChunk from '@mux/upchunk'

to

import * as UpChunk from '@mux/upchunk/dist/upchunk.mjs'

from upchunk.

onyii5119 avatar onyii5119 commented on August 26, 2024 1

import * as UpChunk from '@mux/upchunk/dist/upchunk.mjs' as suggested by @andrewcmyk resolved my issue.

from upchunk.

dylanjha avatar dylanjha commented on August 26, 2024

@AdamBCo can you share the code you're using to import upchunk?

from upchunk.

danya3781 avatar danya3781 commented on August 26, 2024

I can confirm I was having the same issue. I was using typescript and was getting this error:

TypeError: _mux_upchunk__WEBPACK_IMPORTED_MODULE_2__.createUpload is not a function

Downgrading to upchunk version 2.3.1 fixed the issue for me.

from upchunk.

AdamBCo avatar AdamBCo commented on August 26, 2024

@dylanjha The code I was using is identical to what's posted in the example.

@danya3781 Your downgrade suggestion worked. Thank you 🙏🙏

from upchunk.

gkatsev avatar gkatsev commented on August 26, 2024

What version of webpack are you using? Anything special in the configuration?

I'm going to assume that it likely broke with #84

from upchunk.

wmdmark avatar wmdmark commented on August 26, 2024

We also experienced this same issue. We're on an older version of react-scripts (3.x) webpack (4.2.x).

Downgrading like @danya3781 suggested worked for now, but it would be nice to do that.

from upchunk.

troyer avatar troyer commented on August 26, 2024

@gkatsev I tried all your ways and it all gave the same error.

from upchunk.

gkatsev avatar gkatsev commented on August 26, 2024

@troyer are you able to make a small test case repo for me to reproduce? So far I've been unable 🙁

from upchunk.

Wenxchn avatar Wenxchn commented on August 26, 2024

Getting a similar issue with 2.6.0 and Webpack 4.44.2
_mux_upchunk__WEBPACK_IMPORTED_MODULE_10___default.a.createUpload is not a function

Update:
The same issue persists with 2.3.1

Update 2:
Was able to get it to work by downgrading to 2.5.0 but would be nice if this issue could be resolved.

from upchunk.

nvahalik avatar nvahalik commented on August 26, 2024

Encountering the same issue.

We are trying to use it with Vue 2.x to no avail. Using web pack 4.x. I've tried the versions listed here, all to no avail.

from upchunk.

gkatsev avatar gkatsev commented on August 26, 2024

Anyone able to set up a test project on codesandbox or a github repo that showcases this error? Unfortunately, in all my testing, I haven't been able to reproduce it.

from upchunk.

nvahalik avatar nvahalik commented on August 26, 2024

The most frustrating part is that my build is successful.

It is only after the build, when you are trying to upload something, does it actually fail.

Workaround for now: just importing the script using <script src="https://unpkg.com/@mux/upchunk@2"></script>.

A demo sandbox would take me some time to put together...

from upchunk.

onyii5119 avatar onyii5119 commented on August 26, 2024

UpChunk is throwing exception when I try to upload a video with a signed URL. I am using React 17.x and Upchunk 3.x

Uncaught (in promise) TypeError: mux_upchunk__WEBPACK_IMPORTED_MODULE_23_.createUpload is not a function
at ReviewVideoUpload.js:1719:1
(anonymous) @ ReviewVideoUpload.js:1719
await in (anonymous) (async)
(anonymous) @ ReviewVideoUpload.js:1678
callCallback @ react-dom.development.js:3919
invokeGuardedCallbackDev @ react-dom.development.js:3968
invokeGuardedCallback @ react-dom.development.js:4028

Code Snippet:

console.log(">>>In uploadFiles(): muxSignedUrl is: ", muxSignedUrl);

if (file && !lodash.isEmpty(muxSignedUrl)) {
const upload = UpChunk.createUpload({
endpoint: muxSignedUrl,
file: file,
chunkSize: 30720, // Uploads the file in ~30 MB chunks
});

.......
}

from upchunk.

cjpillsbury avatar cjpillsbury commented on August 26, 2024

@onyii5119 if you could share a test project to reproduce your issue (a codesandbox, a simple public github repo, etc.), that would help us identify a root cause of your problem.

from upchunk.

onyii5119 avatar onyii5119 commented on August 26, 2024

@onyii5119 if you could share a test project to reproduce your issue (a codesandbox, a simple public github repo, etc.), that would help us identify a root cause of your problem.

Thank you. My issue is resolved.

from upchunk.

alex-fib avatar alex-fib commented on August 26, 2024

Seems to be an issue when using webpack 4 - I updated mine to be:

import { createUpload } from '@mux/upchunk/dist/upchunk';

As I was getting unit test & typescript issues when using

import * as UpChunk from '@mux/upchunk/dist/upchunk.mjs'

from upchunk.

cjpillsbury avatar cjpillsbury commented on August 26, 2024

Hey Folks! We may have an improvement for some (maybe all? 🤞) of the build tools mentioned here. If anyone wants to give it a try, update to @mux/[email protected] and re-try doing your import like this:

import { createUpload } from '@mux/upchunk';

If you do try, let me know either way whether or not it works now.

from upchunk.

dylanjha avatar dylanjha commented on August 26, 2024

Gonna close this as we confirmed the 3.3.0 fix in the tools that we were able to repro this in. If you're still experiencing this with your tooling please let us know. Thank you all for the reports along the way!

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.