upchunk: _mux_upchunk__WEBPACK_IMPORTED_MODULE_8___default.a.createUpload is not a constructor

I’m getting the following error when trying to create an upload:

_mux_upchunk__WEBPACK_IMPORTED_MODULE_8___default.a.createUpload is not a constructor

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 21 (4 by maintainers)

Most upvoted comments

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

In my environment, I had to change:

import * as UpChunk from '@mux/upchunk'

to

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

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

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