umi proxy [/auth] ====> http://courseauth.uae.shensz.local
✖ Webpack
Compiled with some errors in 48.72s
ERROR Failed to compile with 2 errors 13:47:24
This dependency was not found:
* @/.umi/qiankunContext in ./node_modules/@umijs/plugin-qiankun/lib/slave/runtimePlugin.js, ./src/.umi-production/core/umiExports.ts
To install it, you can run: npm install --save @/.umi/qiankunContext
Child
ERROR in ./node_modules/@umijs/plugin-qiankun/lib/slave/runtimePlugin.js
Module not found: Error: Can't resolve '@/.umi/qiankunContext' in '/Users/elelee/Desktop/projects/guocha/node_modules/@umijs/plugin-qiankun/lib/slave'
@ ./node_modules/@umijs/plugin-qiankun/lib/slave/runtimePlugin.js 30:17-49
@ ./src/.umi-production/core/plugin.ts
@ ./src/.umi-production/umi.ts
@ multi ./node_modules/@umijs/bundler-webpack/lib/getConfig/runtimePublicPathEntry.js ./src/.umi-production/umi.ts
ERROR in ./src/.umi-production/core/umiExports.ts
Module not found: Error: Can't resolve '@/.umi/qiankunContext' in '/Users/elelee/Desktop/projects/guocha/src/.umi-production/core'
@ ./src/.umi-production/core/umiExports.ts 6:0-55 6:0-55
@ ./node_modules/umi/dist/index.esm.js
@ ./node_modules/@umijs/plugin-qiankun/lib/slave/lifecycles.js
@ ./src/.umi-production/umi.ts
@ multi ./node_modules/@umijs/bundler-webpack/lib/getConfig/runtimePublicPathEntry.js ./src/.umi-production/umi.ts
build failed
Error: build failed
at compiler.run (/Users/elelee/Desktop/projects/guocha/node_modules/@umijs/bundler-webpack/lib/index.js:107:27)
at finalCallback (/Users/elelee/Desktop/projects/guocha/node_modules/webpack/lib/MultiCompiler.js:254:12)
at runWithDependencies.err (/Users/elelee/Desktop/projects/guocha/node_modules/webpack/lib/MultiCompiler.js:277:6)
at done (/Users/elelee/Desktop/projects/guocha/node_modules/neo-async/async.js:2931:13)
at runCompilers (/Users/elelee/Desktop/projects/guocha/node_modules/webpack/lib/MultiCompiler.js:181:48)
at err (/Users/elelee/Desktop/projects/guocha/node_modules/webpack/lib/MultiCompiler.js:188:7)
at compiler.run (/Users/elelee/Desktop/projects/guocha/node_modules/webpack/lib/MultiCompiler.js:270:7)
at finalCallback (/Users/elelee/Desktop/projects/guocha/node_modules/webpack/lib/Compiler.js:257:39)
at hooks.done.callAsync.err (/Users/elelee/Desktop/projects/guocha/node_modules/webpack/lib/Compiler.js:273:13)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/elelee/Desktop/projects/guocha/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:42:1)
at AsyncSeriesHook.lazyCompileHook (/Users/elelee/Desktop/projects/guocha/node_modules/tapable/lib/Hook.js:154:20)
at onCompiled (/Users/elelee/Desktop/projects/guocha/node_modules/webpack/lib/Compiler.js:271:21)
at hooks.afterCompile.callAsync.err (/Users/elelee/Desktop/projects/guocha/node_modules/webpack/lib/Compiler.js:681:15)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/elelee/Desktop/projects/guocha/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/Users/elelee/Desktop/projects/guocha/node_modules/tapable/lib/Hook.js:154:20)
at compilation.seal.err (/Users/elelee/Desktop/projects/guocha/node_modules/webpack/lib/Compiler.js:678:31)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
What happens?
挺急的,采用了umi3.0和qiankun。没想到这么多麻烦。还有就是去掉core-js,就报没有core-js依赖的错。 我本地dev开完之后,本地build打包没有问题。 推到服务器构建就出了问题。 初步判断。如果不dev一下,直接打包会报错。 如果不dev一下,src/.umi就会不存在,直接build就会出问题,会生成src/.umi和src/.umi-production
报错信息如下
最小可复现仓库
https://github.com/lei3536/qiankunSonApp
复现步骤,错误日志以及相关配置
相关环境信息