remaxjs / remax

使用真正的 React 构建跨平台小程序
https://remaxjs.github.io/remax/
MIT License
4.57k stars 364 forks source link

[BUG] 引入 react-redux 编译报错 "export 'combineReducers' was not found #1814

Open peaktangf opened 2 years ago

peaktangf commented 2 years ago

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

复现步骤 [清晰描述复现步骤,让别人也能看到问题]

期望结果 [描述你原本期望看到的结果]

复现代码 [请提供一个可复现问题的代码仓库]

版本信息:

其他信息 [如截图等其他信息可以贴在这里]

watsonhaw5566 commented 2 years ago

参考一下 https://github.com/remaxjs/examples/tree/master/wechat-redux 里面的demo。

如果还有问题的话,麻烦提供一个你的repo 仓库地址给我

peaktangf commented 2 years ago

参考一下 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 是有问题的。其他版本未进行过测试。

watsonhaw5566 commented 2 years ago

参考一下 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 进行测试的对吗?

watsonhaw5566 commented 2 years ago

image

@peaktangf 你好,还请你检查一下自己的业务代码,再参考一个 wechat-redux 里面的代码,我使用 2.15.12 测试后是可以的。

peaktangf commented 2 years ago

请问你这边使用的 react-redux 版本是多少

watsonhaw5566 commented 2 years ago

我用的就是 examples 实例里面的。 可以发你一下你报错 repo 地址给我,明天可以看看