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

Terser is not working properly #3418

Closed
domanick55 opened this issue Feb 4, 2019 · 2 comments
Closed

Terser is not working properly #3418

domanick55 opened this issue Feb 4, 2019 · 2 comments

Comments

@domanick55
Copy link

Version

3.4.0

Reproduction link

https://cli.vuejs.org/guide/creating-a-project.html#vue-create

Environment info

  System:
    OS: macOS 10.14.***
    CPU: ***
  Binaries:
    Node: 10.15.1 - ~/Applications/node/bin/node
    Yarn: Not Found
    npm: 6.4.1 - ~/Applications/node/bin/npm
  Browsers:
    Chrome: ***
    Firefox: ***
    Safari: ***
  npmGlobalPackages:
    @vue/cli: 3.4.0

Steps to reproduce

  1. npm install -g @vue/cli
  2. vue create my-project
  3. Following the steps on the interactive configurer (described @ https://cli.vuejs.org/guide/creating-a-project.html#vue-create)
  4. cd my-project
  5. npm run build

What is expected?

I can build without errors, because the project is auto generated and should work.

What is actually happening?

I get error from Terser, like this:

js/app.a1bb0019.js from Terser
TypeError: Cannot read property 'minify' of undefined
    at minify (/path/to/project/node_modules/terser-webpack-plugin/dist/minify.js:175:23)
    at module.exports (/path/to/project/node_modules/terser-webpack-plugin/dist/worker.js:13:40)
    at handle (/path/to/project/node_modules/worker-farm/lib/child/index.js:44:8)
    at process.<anonymous> (/path/to/project/node_modules/worker-farm/lib/child/index.js:51:3)
    at process.emit (events.js:189:13)
    at emit (internal/child_process.js:820:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

In node_modules/terser-webpack-plugin/dist/minify.js I can find this:

[...]

  const {
    error,
    map,
    code,
    warnings
  } = _terser.default.minify({
    [file]: input
  }, terserOptions);

[...]

I've found a workaround by replacing _terser.default.minify by _terser.minify. This is maybe an indicator for a configuration issue. For some reason _terser.default is not defined. Unfortunately I couldn't find a way to fix this permanently. When it comes to automated build management, the workaround can't be applied.

@LinusBorg
Copy link
Member

See: #3407 (comment)

@KarmaBlackshaw
Copy link

KarmaBlackshaw commented Nov 7, 2020

The aforementioned workarounds does not seem to work in my case :( Following also @LinusBorg's comment, it is still not working.

js/app.5f6168a5.js from Terser
Unexpected token operator «+», expected punc «,» [webpack/bootstrap:71,1167][js/app.5f6168a5.js:72,1178]
    at ee (F:\my-business\capstone-cte-ims\ui\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:19541)
    at c (F:\my-business\capstone-cte-ims\ui\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:28244)
    at l (F:\my-business\capstone-cte-ims\ui\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:28335)
    at p (F:\my-business\capstone-cte-ims\ui\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:28475)
    at _ (F:\my-business\capstone-cte-ims\ui\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:28587)
    at F:\my-business\capstone-cte-ims\ui\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:43316
    at F:\my-business\capstone-cte-ims\ui\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:28976
    at G (F:\my-business\capstone-cte-ims\ui\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:42192)
    at ge (F:\my-business\capstone-cte-ims\ui\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:48272)
    at Ae (F:\my-business\capstone-cte-ims\ui\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:48998)

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

3 participants