react umi项目运行报错

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration[0] has an unknown property 'experiments'. These properties are valid:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions? }
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration[0] has an unknown property 'experiments'. These properties are valid:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, externals?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions? }
    at Object.webpack (D:\WXapp\front\node_modules\@umijs\deps\compiled\webpack\4\bundle4.js:138983:9)
    at Bundler.setupDevServerOpts (D:\WXapp\front\node_modules\@umijs\bundler-webpack\lib\index.js:193:40)
    at D:\WXapp\front\node_modules\@umijs\preset-built-in\lib\plugins\commands\dev\dev.js:300:30
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (D:\WXapp\front\node_modules\@umijs\preset-built-in\lib\plugins\commands\dev\dev.js:74:103)
    at _next (D:\WXapp\front\node_modules\@umijs\preset-built-in\lib\plugins\commands\dev\dev.js:76:194)

umi3.5.7的问题,降低版本至3.4.25后可行。

另外

报错Cannot find module 'webpack/lib/ModuleFilenameHelpers'

运行npm link webpack解决

你可能感兴趣的:(杂七杂八)