remax
remax copied to clipboard
[BUG] 引入 react-redux 编译报错 "export 'combineReducers' was not found
bug 描述 引入 react-redux 之后编译报错,如下:
./src/redux/index.js 3:24-39
"export 'combineReducers' was not found in './index'
at HarmonyImportSpecifierDependency._getErrors (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:109:11)
at HarmonyImportSpecifierDependency.getWarnings (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:60:15)
at Compilation.reportDependencyErrorsAndWarnings (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/Compilation.js:1454:24)
at /Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/Compilation.js:1258:10
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:18:1)
at AsyncSeriesHook.lazyCompileHook (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/Compilation.js:1253:28)
at /Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/Compiler.js:672:17
at _done (eval at create (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1)
at eval (eval at create (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:30:22)
at /Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/Compilation.js:1185:12
at /Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/Compilation.js:1097:9
at processTicksAndRejections (internal/process/task_queues.js:79:11)
@ ./src/app.js
@ ./src/app.entry.js
@ multi (webpack)-inject-plugin/dist/webpack-inject-plugin.loader?id=webpack-inject-module-1 @remax/apply-runtime-options ./src/app.entry.js
./src/redux/index.js 3:12-23
"export 'createStore' was not found in './index'
at HarmonyImportSpecifierDependency._getErrors (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:109:11)
at HarmonyImportSpecifierDependency.getWarnings (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:60:15)
at Compilation.reportDependencyErrorsAndWarnings (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/Compilation.js:1454:24)
at /Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/Compilation.js:1258:10
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:18:1)
at AsyncSeriesHook.lazyCompileHook (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/Compilation.js:1253:28)
at /Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/Compiler.js:672:17
at _done (eval at create (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1)
at eval (eval at create (/Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:30:22)
at /Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/Compilation.js:1185:12
at /Users/peak/Desktop/demo/小程序/exhibition_miniapp/node_modules/webpack/lib/Compilation.js:1097:9
at processTicksAndRejections (internal/process/task_queues.js:79:11)
@ ./src/app.js
@ ./src/app.entry.js
@ multi (webpack)-inject-plugin/dist/webpack-inject-plugin.loader?id=webpack-inject-module-1 @remax/apply-runtime-options ./src/app.entry.js
复现步骤 [清晰描述复现步骤,让别人也能看到问题]
期望结果 [描述你原本期望看到的结果]
复现代码 [请提供一个可复现问题的代码仓库]
版本信息:
- remax 版本: 2.9.1
- 手机型号 [e.g. iPhone X]
- 小程序端 [e.g. 微信小程序]
- 小程序版本[e.g. 2.3.0]
- 开发环境 [e.g. mac OS]
其他信息 [如截图等其他信息可以贴在这里]
参考一下 https://github.com/remaxjs/examples/tree/master/wechat-redux 里面的demo。
如果还有问题的话,麻烦提供一个你的repo 仓库地址给我
参考一下 https://github.com/remaxjs/examples/tree/master/wechat-redux 里面的demo。
如果还有问题的话,麻烦提供一个你的repo 仓库地址给我
测试了一下,发现是 remax 版本的问题,测试发现 2.0.0、2.0.7、2.3.0 是正常的,2.9.1、2.15.11 是有问题的。其他版本未进行过测试。
参考一下 https://github.com/remaxjs/examples/tree/master/wechat-redux 里面的demo。 如果还有问题的话,麻烦提供一个你的repo 仓库地址给我
测试了一下,发现是 remax 版本的问题,测试发现 2.0.0、2.0.7、2.3.0 是正常的,2.9.1、2.15.11 是有问题的。其他版本未进行过测试。
您是用的 https://github.com/remaxjs/examples/tree/master/wechat-redux 进行测试的对吗?
@peaktangf 你好,还请你检查一下自己的业务代码,再参考一个 wechat-redux 里面的代码,我使用 2.15.12 测试后是可以的。
请问你这边使用的 react-redux 版本是多少
我用的就是 examples 实例里面的。 可以发你一下你报错 repo 地址给我,明天可以看看