1일1끄적

[webpack]Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema. ~ 본문

개발/에러기록

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

inkor 2022. 2. 14. 20:49

▶날짜: 22-02-14

 

▶상황&에러내용: 

 

자바스크립트 - 가상키보드 만들기 중 

npm build run 실행 후 에러 발생.

 

▶해결방법:  구글 검색=>https://blog.hajs.me/263

webpack을 처음 접하면서 겪은 첫 에러라서 흥미로웠다.

nvalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration has an unknown property 'plugin'. These properties are valid:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, externalsPresets?, externalsType?, ignoreWarnings?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, snapshot?, stats?, target?, watch?, watchOptions? }
   -> Options object as provided by the user.
   For typos: please correct them.
   For loader options: webpack >= v2.0.0 no longer allows custom properties in configuration.
     Loaders should be updated to allow passing options via loader options in module.rules.
     Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
     plugins: [
       new webpack.LoaderOptionsPlugin({
         // test: /\.xxx$/, // may apply this only for some modules
           plugin: …
         }
       })
     ]

 

위와 같이 'plugin' 에서 에러가 발생했다고 알 수 있으나, 정확히 어디부분의 plugin인지 찾아보니 webpack.config.js 부분에서 plugin <- 이부분을 plugins 로 수정하니 잘 실행되었다. 아마 TerserPlugin, HtomwWebpackPlugin, MiniCssExtractPlugin, CssMinimizerPlugin 등 plugin을 여러개 사용해서 s가 붙어야 실행되는게 아니었을까..싶다. 
생각보다 스펠링이나 오타의 유형의 에러를 가장 많이 겪었는데 , 이번에는 그동안 겪었던 단순 철자가 틀린것이 아닌 뭔가 조금은 색다른 느낌이라서 남겨보고싶어졌다. 

 
 

※ 결과