added 2059 packages from 1130 contributors in 43.162s
yarn build
yarn run v1.22.15
$ umi build
Bundle with webpack 5...
[info] [webpackbar] Compiling Webpack
(node:10777) [DEP_WEBPACK_CONFIGURATION_OPTIMIZATION_NO_EMIT_ON_ERRORS] DeprecationWarning: optimization.noEmitOnErrors is deprecated in favor of optimization.emitOnErrors
(node:10777) [DEP_WEBPACK_COMPILATION_OPTIMIZE_CHUNK_ASSETS] DeprecationWarning: optimizeChunkAssets is deprecated (use Compilation.hooks.processAssets instead and use one of Compilation.PROCESS_ASSETSSTAGE* as stage option)
(node:10777) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Module not found: Error: Can't resolve '/var/lib/jenkins/workspace/ant-design-pro-master/src/pages/user/Login' in '/var/lib/jenkins/workspace/ant-design-pro-master/src/.umi-production/core'
ERROR in ./src/.umi-production/core/routes.ts 26:21-28:86
Module not found: Error: Can't resolve '/var/lib/jenkins/workspace/ant-design-pro-master/src/pages/user/Login' in '/var/lib/jenkins/workspace/ant-design-pro-master/src/.umi-production/core'
@ ./src/.umi-production/umi.ts 9:0-42 25:33-42
webpack compiled with 1 error
null
build failed
Error: build failed
at /var/lib/jenkins/workspace/ant-design-pro-master/node_modules/@umijs/bundler-webpack/lib/index.js:172:29
at /var/lib/jenkins/workspace/ant-design-pro-master/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:114591:14
at processQueueWorker (/var/lib/jenkins/workspace/ant-design-pro-master/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:114529:6)
at processTicksAndRejections (internal/process/task_queues.js:75:11)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
🧐 问题描述
本地打包没问题 但是在Jenkins部署报错,不知道该从哪儿入手调整,不知道是不是dockerfile配置错了
💻 报错提示
npm WARN lifecycle ant-design-pro@5.0.0~postinstall: cannot run in wd ant-design-pro@5.0.0 umi g tmp (wd=/var/lib/jenkins/workspace/ant-design-pro-master) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/jest-environment-jsdom-fourteen/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 2059 packages from 1130 contributors in 43.162s
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating [success] [webpackbar] Webpack: Compiled with some errors in 1.02m ERROR Failed to compile with 1 errors1:57:15 PM
error in ./src/.umi-production/core/routes.ts
Module not found: Error: Can't resolve '/var/lib/jenkins/workspace/ant-design-pro-master/src/pages/user/Login' in '/var/lib/jenkins/workspace/ant-design-pro-master/src/.umi-production/core'
ERROR in ./src/.umi-production/core/routes.ts 26:21-28:86 Module not found: Error: Can't resolve '/var/lib/jenkins/workspace/ant-design-pro-master/src/pages/user/Login' in '/var/lib/jenkins/workspace/ant-design-pro-master/src/.umi-production/core' @ ./src/.umi-production/umi.ts 9:0-42 25:33-42
webpack compiled with 1 error null build failed Error: build failed at /var/lib/jenkins/workspace/ant-design-pro-master/node_modules/@umijs/bundler-webpack/lib/index.js:172:29 at /var/lib/jenkins/workspace/ant-design-pro-master/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:114591:14 at processQueueWorker (/var/lib/jenkins/workspace/ant-design-pro-master/node_modules/@umijs/deps/compiled/webpack/5/bundle5.js:114529:6) at processTicksAndRejections (internal/process/task_queues.js:75:11) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.