mOxie is undefined
Hi, I'm trying to use plupload (v1.2.1) in a CommonJS / Browserify environment
var plupload = require('libs/plupload/js/plupload.full.min');
But when that require runs I always get mOxie is undefined:
plupload.full.min.js:28 Uncaught ReferenceError: mOxie is not defined
Does plupload strictly depend on the mOxie module?
Im not sure this is related to being run in a CommonJS environment. I've looked into the source of plupload.dev.js and moxie.js and they don't seem to use the UMD pattern. Are they compatible with CommonJS?
Plupload v1.2.1 doesn't depend on mOxie.
Hi, I ran into the same issue. Patched it up by adding this between mOxie and plupload:
var mOxie = exports.mOxie;
And at the end of the minified script, I added this:
module.exports = plupload;
@OriginalEXE Great stuff. What do mean exactly by "between mOxie and plupload" ?
I meant in this file: https://raw.githubusercontent.com/moxiecode/plupload/master/js/plupload.full.min.js
Here is how my file looks now: http://pastebin.com/raw/4BSePwA9
@OriginalEXE nice quick fix, thanks for sharing.
Thanks @OriginalEXE. It would be great if this was worked into the full package somehow. Would if I could... :)
@jayarjo How do you suggest that one requires plupload? I'm still having this issue when requiring plupload.full.min.js (and any other built file for that matter).
The fix above works for me, but it means I have to manually intervene each time I build.

What do you mean each time you build, how often do you build plupload?
For instance, when I do npm install, which will eventually automated as part of my build process. I'm more talking about building my project, rather than plupload (I am using the dist files currently)
Oh, got it.
Yeah it's a pain in the ass, for now I would recommend just requiring a local version instead of relying on the npm-one, until they add proper support for this.
Sounds like a plan, thanks again @OriginalEXE :smiley:
Instead of using a local copy you can also publish your own module on NPM, with the suggested fix.
I am still have this issue. my plupupload version is 2.1.2.
this issue cured on chrome at version 50
I am still have this issue. my plupupload version is 2.1.1.

my plupupload version is 2.1.1 I include moxie.js and plupload.dev.js.
require 'plupload/js/moxie.js' require 'plupload/js/plupload.dev.js'
but still have this issue.

@simonqian var m = require('./vendors/upload/moxie'); window.moxie = m.moxie; window.mOxie = m.mOxie; require('./vendors/plupload.dev');
@ksprider This was very helpful to me, thank you!
great !!
Floor 3rd is right, that's awesome