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

WebPack 5.62.0 raises "Unexpected token: punc ()) " #14662

Closed
Carsten-Leue opened this issue Nov 5, 2021 · 6 comments
Closed

WebPack 5.62.0 raises "Unexpected token: punc ()) " #14662

Carsten-Leue opened this issue Nov 5, 2021 · 6 comments

Comments

@Carsten-Leue
Copy link

Carsten-Leue commented Nov 5, 2021

After upgrading to 5.62.0 I am getting:

ERROR in main.js
main.js from Terser plugin
Unexpected token: punc ()) [webpack://./node_modules/graceful-fs/graceful-fs.js:87,6][main.js:41529,37]
    at js_error (C:\d\blaze-secrets-injector-cli-deb\node_modules\terser\dist\bundle.min.js:550:11)
    at croak (C:\d\blaze-secrets-injector-cli-deb\node_modules\terser\dist\bundle.min.js:1274:9)
    at token_error (C:\d\blaze-secrets-injector-cli-deb\node_modules\terser\dist\bundle.min.js:1282:9)
    at unexpected (C:\d\blaze-secrets-injector-cli-deb\node_modules\terser\dist\bundle.min.js:1288:9)
    at semicolon (C:\d\blaze-secrets-injector-cli-deb\node_modules\terser\dist\bundle.min.js:1326:56)
    at simple_statement (C:\d\blaze-secrets-injector-cli-deb\node_modules\terser\dist\bundle.min.js:1583:73)
    at statement (C:\d\blaze-secrets-injector-cli-deb\node_modules\terser\dist\bundle.min.js:1396:19)
    at _embed_tokens_wrapper (C:\d\blaze-secrets-injector-cli-deb\node_modules\terser\dist\bundle.min.js:1339:26)
    at block_ (C:\d\blaze-secrets-injector-cli-deb\node_modules\terser\dist\bundle.min.js:2172:20)
    at _function_body (C:\d\blaze-secrets-injector-cli-deb\node_modules\terser\dist\bundle.min.js:2084:21)

Compiling the identical project with 5.61.0 is working without errors.

@webpack-bot
Copy link
Contributor

webpack-bot commented Nov 5, 2021

For maintainers only:

  • webpack-4
  • webpack-5
  • bug
  • critical-bug
  • enhancement
  • documentation
  • performance
  • dependencies
  • question

@Carsten-Leue
Copy link
Author

Carsten-Leue commented Nov 5, 2021

const webpack = require('webpack');

module.exports = {
  entry: './index.js',
  devtool: 'source-map',
  target: 'node14',
  mode: 'production',
  resolve: {
    extensions: ['.js'],
  },
  plugins: [
    new webpack.BannerPlugin({
      banner: '#!/usr/bin/env node',
      raw: true,
    }),
  ],
};

@sokra
Copy link
Member

sokra commented Nov 5, 2021

Could you disable optimization.minimize: true and look into line main.js:41529?

@cbartondock
Copy link

cbartondock commented Nov 5, 2021

I am also seeing this error after upgrading from 5.61 to 5.62

@sokra
Copy link
Member

sokra commented Nov 5, 2021

Found the problem... Fixing...

@sokra sokra closed this as completed in 610d435 Nov 5, 2021
sokra added a commit that referenced this issue Nov 5, 2021
@sokra
Copy link
Member

sokra commented Nov 5, 2021

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

4 participants