Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npx webpack, show ERROR in main.js from Terser #8694

Closed
15992033543 opened this issue Feb 2, 2019 · 14 comments
Closed

npx webpack, show ERROR in main.js from Terser #8694

15992033543 opened this issue Feb 2, 2019 · 14 comments

Comments

@15992033543
Copy link

I write a demo according to official documents。

npm i webpack webpack-cli --save-dev

the project directory like this:

index.html
-src
-index.js
package.json

when i run npx webpack,Error occurred

ERROR in main.js from Terser
TypeError: Cannot read property 'minify' of undefined

@elvishp2006

This comment has been minimized.

1 similar comment
@SamuelNitsche

This comment has been minimized.

@SayHeyD
Copy link

SayHeyD commented Feb 2, 2019

I was trying to get tailwindcss working with Django and thought it's some compatibility problem.

With Laravel Mix

Updated with workaround

@SamuelNitsche
Copy link

Head over to webpack-contrib/terser-webpack-plugin#66 for a workaround.

@TomCosta
Copy link

TomCosta commented Feb 3, 2019

Simple run:
npm install terser@3.14.1 --save-dev
It solves my problem!

@Mspataro
Copy link

Mspataro commented Feb 3, 2019

Is this a recent issue? The guide worked for me 2 weeks ago and my project still works. I noticed though when I tried to recreate my environment for a co-worker it kept failing because of this issue.

TomCosta's workaround solved my problem as well!

@SamuelNitsche
Copy link

Yeah, this issue occurred yesterday after a new release with breaking changes.

@SayHeyD
Copy link

SayHeyD commented Feb 3, 2019

@Mspataro I was trying to get this to work for the last week and stumbled across the same error everytime when I tried to change something. The first time i got the error was at thursday I think.

@YongzeYao
Copy link

I ran into the same issue today. TomCosta's workaround works.

@rowlandjumbo
Copy link

Tom Costa is da man! Thanks!

@alexander-akait
Copy link
Member

Close in favor webpack-contrib/terser-webpack-plugin#66

@dawsonc623
Copy link

I realize this is closed, but it looks like we are stuck until Webpack updates its dependency on terser-webpack-plugin to 1.2.2. Is this happening soon?

@alexander-akait
Copy link
Member

/cc @sokra

@sokra
Copy link
Member

sokra commented Feb 4, 2019

Nothing to do on webpack side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests