Invalid options object. Dev Server has been initialized using an options object that does not match

Invalid options object. Dev Server has been initialized using an options object that does not match

错误详细信息一

Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options has an unknown property ‘watchContentBase’. These properties are valid:
object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, http2?, https?, ipc?, liveReload?, magicHtml?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, server?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }

  • 问题原因
    1. webpack 不识别 watchContentBase
    2. 猜测你想配置的是 watch, 默认 watch:true
  • 解决建议
    1. 将 watchContentBase 配置 修改为 watch,详细配置 请参考webpack官方文档

错误详细信息二

Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.

  • configuration.output has an unknown property ‘jsonpFunction’. These properties are valid:
    object { assetModuleFilename?, asyncChunks?, auxiliaryComment?, charset?, chunkFilename?, chunkFormat?, chunkLoadTimeout?, chunkLoading?, chunkLoadingGlobal?, clean?, compareBeforeEmit?, crossOriginLoading?, cssChunkFilename?, cssFilename?, devtoolFallbackModuleFilenameTemplate?, devtoolModuleFilenameTemplate?, devtoolNamespace?, enabledChunkLoadingTypes?, enabledLibraryTypes?, enabledWasmLoadingTypes?, environment?, filename?, globalObject?, hashDigest?, hashDigestLength?, hashFunction?, hashSalt?, hotUpdateChunkFilename?, hotUpdateGlobal?, hotUpdateMainFilename?, iife?, importFunctionName?, importMetaName?, library?, libraryExport?, libraryTarget?, module?, path?, pathinfo?, publicPath?, scriptType?, sourceMapFilename?, sourcePrefix?, strictModuleErrorHandling?, strictModuleExceptionHandling?, trustedTypes?, umdNamedDefine?, uniqueName?, wasmLoading?, webassemblyModuleFilename?, workerChunkLoading?, workerWasmLoading? }
    -> Options affecting the output of the compilation. output options tell webpack how to write the compiled files to disk.
    Did you mean output.chunkLoadingGlobal (BREAKING CHANGE since webpack 5)?
    • 问题原因
      1. webpack5 废弃了 jsonpFunction,改为 chunkLoadingGlobal
    • 修改方案
      1. jsonpFunction 配置修改为 chunkLoadingGlobal
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值