我正在尝试注入中间件并通过它加载pl上传。以下是我试图在应用程序中集成的程序包。
https://www.npmjs.com/package/plupload
https://www.npmjs.com/package/redux-plupload
我得到了以下错误。我试着重新安装软件包并运行,但没有成功。
如果我遗漏了什么,需要建议。
ReferenceError: Image is not defined
at .....node_modulespluploadjsplupload.full.min.js:13:12305
at .....node_modulespluploadjsplupload.full.min.js:13:12504
at .....node_modulespluploadjsplupload.full.min.js:13:13299
at .....node_modulespluploadjsplupload.full.min.js:13:709
at i (.....node_modulespluploadjsplupload.full.min.js:13:402)
at n (.....node_modulespluploadjsplupload.full.min.js:13:687)
at .....node_modulespluploadjsplupload.full.min.js:13:5378
at Object.<anonymous> (.....node_modulespluploadjsplupload.full.min.js:16:11339)
at i (.....node_modulespluploadjsplupload.full.min.js:13:51)
at i (.....node_modulespluploadjsplupload.full.min.js:13:193)
at Object.<anonymous> (.....node_modulespluploadjsplupload.full.min.js:13:209)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Module._compile (.....node_modulespirateslibindex.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Object.newLoader [as .js] (.....node_modulespirateslibindex.js:104:7)
at Module.load (internal/modules/cjs/loader.js:600:32)
更新-
只是为了提供更多的代码见解,下面是代码
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()
)
)
);
}
谢谢!
我们发现,似乎是由于服务器渲染它中断了加载Pl上传和moxie。
我们还没有任何解决方法。:(
不过谢谢。