通过中间件引用Plupload
Reference Plupload through middleware
我正在尝试注入中间件并通过它加载 pl upload。以下是我试图集成到我的应用程序中的包。
https://www.npmjs.com/package/plupload
https://www.npmjs.com/package/redux-plupload
我遇到了以下错误。我尝试重新安装软件包和 运行 但是没有成功。
如果我遗漏了什么,需要建议。
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)
更新 -
只是为了提供更多代码见解,下面是代码
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。
我们还没有任何解决方法。 :(
谢谢。
我正在尝试注入中间件并通过它加载 pl upload。以下是我试图集成到我的应用程序中的包。
https://www.npmjs.com/package/plupload
https://www.npmjs.com/package/redux-plupload
我遇到了以下错误。我尝试重新安装软件包和 运行 但是没有成功。
如果我遗漏了什么,需要建议。
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)
更新 -
只是为了提供更多代码见解,下面是代码
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。
我们还没有任何解决方法。 :(
谢谢。