I am trying to inject middle ware and load pl upload through that. Below are the packages I am trying to integrate inside my application.
https://www.npmjs.com/package/plupload
https://www.npmjs.com/package/redux-plupload
I am getting below error. I tried reinstall packages and run however no luck.
Need suggestion if I am missing anything.
ReferenceError: Image is not defined
at .....\node_modules\plupload\js\plupload.full.min.js:13:12305
at .....\node_modules\plupload\js\plupload.full.min.js:13:12504
at .....\node_modules\plupload\js\plupload.full.min.js:13:13299
at .....\node_modules\plupload\js\plupload.full.min.js:13:709
at i (.....\node_modules\plupload\js\plupload.full.min.js:13:402)
at n (.....\node_modules\plupload\js\plupload.full.min.js:13:687)
at .....\node_modules\plupload\js\plupload.full.min.js:13:5378
at Object.<anonymous> (.....\node_modules\plupload\js\plupload.full.min.js:16:11339)
at i (.....\node_modules\plupload\js\plupload.full.min.js:13:51)
at i (.....\node_modules\plupload\js\plupload.full.min.js:13:193)
at Object.<anonymous> (.....\node_modules\plupload\js\plupload.full.min.js:13:209)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Module._compile (.....\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Object.newLoader [as .js] (.....\node_modules\pirates\lib\index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:600:32)
UPDATE -
Just to give more code insight, Below is the code
import {createMiddleware as createUploaderMiddleware} from 'redux-plupload';
import plupload from 'plupload';
const uploadDocmentMiddleware = (config) => (store) => (next) => (action) => {
// For now just returning some value
return true;
};
export default function configureStore(initialState) {
const uploaderMiddleware = createUploaderMiddleware(plupload, {
uploadDocmentMiddleware
});
return createStore(
rootReducer,
initialState,
// Initiate redux dev tools
composeWithDevTools(
applyMiddleware(
FirstMiddleware(config),
SecondMiddleware(config),
...
.....
// middle ware for pl upload
uploaderMiddleware(config),
typeof window !== 'undefined' && reduxImmutableStateInvariant()
)
)
);
}
Thank you!
We figured out, seems due to server rendering it breaks to load Pl upload and moxie.
We do not have any workaround yet for same. :(
Thanks though.