인프런 영문 브랜드 로고
인프런 영문 브랜드 로고
BEST
Programming

/

Front-end

Understanding and practicing the front-end development environment (webpack, babel, eslint..)

You can understand the development environment that has already been created. You can create a development environment from scratch.

(4.9) 203 reviews

2,945 students

Node.js
Webpack
Babel
ESLint
Thumbnail

Here's how to fix terser-webpack-plugin errors.

This lecture uses Webpack version 4, but recently it has been majorly updated to version 5. Plugins related to Webpack are also released as updated versions for compatibility, and among them, terser-webpack-plugin used in the lecture has been updated from 4 to 5. Some of you may have encountered error messages because of this, so please refer to the method shared by "쭁" below.

Error message

  • "TypeError: Cannot read property 'javascript' of undefined"
  • Hi you are using Webpack 4 and Terser ^5.0.0 . This version of Terser is for Webpack 5, you need to set version "terser-webpack-plugin": "^4.2.3", in package.json file

How to solve

  • In package.json, change the terser-webpack-plugin version from 5 to ^4.2.3 Change to

Source: https://www.inflearn.com/questions/86666

Comment