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

minifying issue / had to revert to standard minifier #28

Closed
ivonigC opened this issue Nov 12, 2021 · 10 comments
Closed

minifying issue / had to revert to standard minifier #28

ivonigC opened this issue Nov 12, 2021 · 10 comments

Comments

@ivonigC
Copy link

ivonigC commented Nov 12, 2021

I had an issue recently with the minifier. Came up to the following error even though the minifying works with the classic standard-minifier-js

 /Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/scope-tracker.js:47:34:
   unknown: Cannot read property 'add' of undefined while minifying packages/modules.js
   at ScopeTracker.addReference
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/scope-tracker.js:47:34)
   at ReferencedIdentifier
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/index.js:196:26)
   at newFn
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/visitors.js:220:17)
   at bfsTraverse
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/bfs-traverse.js:32:43)
   at Mangler.collect
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/index.js:229:7)
   at Mangler.run
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/index.js:54:12)
   at PluginPass.exit
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/index.js:558:19)
   at newFn
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/visitors.js:179:21)
   at NodePath._call
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/path/context.js:55:20)
   at NodePath.call
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/path/context.js:42:17)
   at NodePath.visit
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/path/context.js:99:8)
   at TraversalContext.visitQueue
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/context.js:112:16)
   at TraversalContext.visitSingle
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/context.js:84:19)
   at TraversalContext.visit
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/context.js:140:19)
   at Function.traverse.node
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/index.js:84:17)
   at traverse
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/index.js:66:12)
   at transformFile
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/core/lib/transformation/index.js:107:29)
   at transformFile.next (<anonymous>)
   at run
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/core/lib/transformation/index.js:35:12)
   at run.next (<anonymous>)
   at Function.<anonymous>
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/core/lib/transform-ast.js:28:41)
   at Generator.next (<anonymous>)
   at evaluateSync
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/gensync/index.js:244:28)
   at Function.sync
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/gensync/index.js:84:14)
   at Object.transformFromAst
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/core/lib/transform-ast.js:38:35)
   at Object.minify
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/index.js:183:33)
   at Object.minify (packages/babel-compiler.js:59:29)
   at meteorJsMinify (packages/zodern_minifier-js.js:70:29)
   at MeteorBabelMinifier.minifyOneFile (packages/fastMinifier/plugin/minify-js.js:31:12)
   at packages/zodern:caching-minifier/caching-minifier.js:59:23
   at Function.Profile.time (packages/zodern:caching-minifier/caching-minifier.js:14:5)
   at MeteorBabelMinifier.minifyFile (packages/zodern:caching-minifier/caching-minifier.js:58:15)
   at packages/fastMinifier/plugin/minify-js.js:167:27
   at Function.Profile.time (packages/fastMinifier/plugin/minify-js.js:12:5)
   at packages/fastMinifier/plugin/minify-js.js:166:17
   at Array.forEach (<anonymous>)
   at MeteorBabelMinifier.<anonymous> (packages/fastMinifier/plugin/minify-js.js:147:9)
   at MeteorBabelMinifier.processFilesForBundle (packages/fastMinifier/plugin/minify-js.js:8:19)
   
   
   While minifying app code:

   /Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/scope-tracker.js:47:34:
   unknown: Cannot read property 'add' of undefined while minifying packages/modules.js
   at ScopeTracker.addReference
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/scope-tracker.js:47:34)
   at ReferencedIdentifier
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/index.js:196:26)
   at newFn
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/visitors.js:220:17)
   at bfsTraverse
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/bfs-traverse.js:32:43)
   at Mangler.collect
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/index.js:229:7)
   at Mangler.run
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/index.js:54:12)
   at PluginPass.exit
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/index.js:558:19)
   at newFn
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/visitors.js:179:21)
   at NodePath._call
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/path/context.js:55:20)
   at NodePath.call
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/path/context.js:42:17)
   at NodePath.visit
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/path/context.js:99:8)
   at TraversalContext.visitQueue
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/context.js:112:16)
   at TraversalContext.visitSingle
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/context.js:84:19)
   at TraversalContext.visit
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/context.js:140:19)
   at Function.traverse.node
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/index.js:84:17)
   at traverse
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/index.js:66:12)
   at transformFile
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/core/lib/transformation/index.js:107:29)
   at transformFile.next (<anonymous>)
   at run
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/core/lib/transformation/index.js:35:12)
   at run.next (<anonymous>)
   at Function.<anonymous>
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/core/lib/transform-ast.js:28:41)
   at Generator.next (<anonymous>)
   at evaluateSync
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/gensync/index.js:244:28)
   at Function.sync
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/gensync/index.js:84:14)
   at Object.transformFromAst
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/core/lib/transform-ast.js:38:35)
   at Object.minify
   (/Users/ivonig/.meteor/packages/zodern_standard-minifier-js/.4.0.0.16lpcf4.10ks++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/meteor-babel/index.js:183:33)
   at Object.minify (packages/babel-compiler.js:59:29)
   at meteorJsMinify (packages/zodern_minifier-js.js:70:29)
   at MeteorBabelMinifier.minifyOneFile (packages/fastMinifier/plugin/minify-js.js:31:12)
   at packages/zodern:caching-minifier/caching-minifier.js:59:23
   at Function.Profile.time (packages/zodern:caching-minifier/caching-minifier.js:14:5)
   at MeteorBabelMinifier.minifyFile (packages/zodern:caching-minifier/caching-minifier.js:58:15)
   at packages/fastMinifier/plugin/minify-js.js:167:27
   at Function.Profile.time (packages/fastMinifier/plugin/minify-js.js:12:5)
   at packages/fastMinifier/plugin/minify-js.js:166:17
   at Array.forEach (<anonymous>)
   at MeteorBabelMinifier.<anonymous> (packages/fastMinifier/plugin/minify-js.js:147:9)
   at MeteorBabelMinifier.processFilesForBundle (packages/fastMinifier/plugin/minify-js.js:8:19)
   

Unfortunately now we can't access Sourcemaps anymore so that's pity.
The only main difference with last working minifying was this package been added:

"screenfull": {
  "version": "6.0.0",
  "resolved": "https://registry.npmjs.org/screenfull/-/screenfull-6.0.0.tgz",

},
@afrokick
Copy link

afrokick commented Jan 14, 2022

Me too.

Meteor: 2.5.3

Meteor packages:

zodern:caching-minifier      added, version 0.4.0
zodern:minifier-js           added, version 4.1.0
zodern:standard-minifier-js  added, version 4.1.1

Npm package: "pdfjs-dist": "2.10.377",

While minifying app code:                     

/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/scope-tracker.js:47:34:
unknown: Cannot read property 'add' of undefined while minifying
dynamic/node_modules/pdfjs-dist/build/pdf.js
at ScopeTracker.addReference
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/scope-tracker.js:47:34)
at ReferencedIdentifier
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/index.js:196:26)
at newFn
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/visitors.js:212:17)
at bfsTraverse
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/bfs-traverse.js:32:43)
at Mangler.collect
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/index.js:229:7)
at Mangler.run
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/index.js:54:12)
at PluginPass.exit
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/babel-plugin-minify-mangle-names/lib/index.js:558:19)
at newFn
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/visitors.js:171:21)
at NodePath._call
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/path/context.js:53:20)
at NodePath.call
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/path/context.js:99:8)
at TraversalContext.visitQueue
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/context.js:99:16)
at TraversalContext.visitSingle
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/context.js:73:19)
at TraversalContext.visit
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/context.js:127:19)
at Function.traverse.node
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/index.js:76:17)
at traverse
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/traverse/lib/index.js:56:12)
at transformFile
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/core/lib/transformation/index.js:105:29)
at transformFile.next (<anonymous>)
at run
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/core/lib/transformation/index.js:33:12)
at run.next (<anonymous>)
at Function.<anonymous>
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/core/lib/transform-ast.js:26:41)
at Generator.next (<anonymous>)
at evaluateSync
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/gensync/index.js:251:28)
at Function.sync
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/gensync/index.js:89:14)
at Object.transformFromAst
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@babel/core/lib/transform-ast.js:36:35)
at Object.minify
(/Users/asosnovskiy/.meteor/packages/zodern_standard-minifier-js/.4.1.1.1aboepx.c8zd++os+web.browser+web.browser.legacy+web.cordova/plugin.fastMinifier.os/npm/node_modules/meteor/babel-compiler/node_modules/@meteorjs/babel/index.js:185:33)
at Object.minify (packages/babel-compiler.js:59:29)
at meteorJsMinify (packages/zodern_minifier-js.js:70:29)
at MeteorBabelMinifier.minifyOneFile (packages/fastMinifier/plugin/minify-js.js:31:12)
at packages/zodern:caching-minifier/caching-minifier.js:59:23
at Function.Profile.time (packages/zodern:caching-minifier/caching-minifier.js:14:5)
at MeteorBabelMinifier.minifyFile (packages/zodern:caching-minifier/caching-minifier.js:58:15)
at packages/fastMinifier/plugin/minify-js.js:167:27
at Function.Profile.time (packages/fastMinifier/plugin/minify-js.js:12:5)
at packages/fastMinifier/plugin/minify-js.js:166:17
at Array.forEach (<anonymous>)
at MeteorBabelMinifier.<anonymous> (packages/fastMinifier/plugin/minify-js.js:147:9)
at MeteorBabelMinifier.processFilesForBundle (packages/fastMinifier/plugin/minify-js.js:8:19)

@edemaine
Copy link

edemaine commented Feb 7, 2022

I get a similar error after upgrading my app from Meteor 1.11.1 to 2.5.3. Oddly I get it while minifying packages/modules.js.

C:\Users\edemaine\AppData\Local\.meteor\packages\zodern_standard-minifier-js\4.1.1\plugin.fastMinifier.os\npm\node_modules\meteor\babel-compiler\node_modules\babel-plugin-minify-mangle-names\lib\scope-tracker.js:47:34:
   unknown: Cannot read property 'add' of undefined while minifying packages/modules.js
   at ScopeTracker.addReference
   (C:\Users\edemaine\AppData\Local\.meteor\packages\zodern_standard-minifier-js\4.1.1\plugin.fastMinifier.os\npm\node_modules\meteor\babel-compiler\node_modules\babel-plugin-minify-mangle-names\lib\scope-tracker.js:47:34)

I tried upgrading zodern:standard-minifier-js, but that didn't fix anything.

I'm guessing the issue is the update to babel-compiler, but I can't downgrade because of other dependencies (e.g. accounts-base).

@titivermeesch
Copy link

titivermeesch commented Feb 21, 2022

I get a similar error after upgrading my app from Meteor 1.11.1 to 2.5.3. Oddly I get it while minifying packages/modules.js.

C:\Users\edemaine\AppData\Local\.meteor\packages\zodern_standard-minifier-js\4.1.1\plugin.fastMinifier.os\npm\node_modules\meteor\babel-compiler\node_modules\babel-plugin-minify-mangle-names\lib\scope-tracker.js:47:34:
   unknown: Cannot read property 'add' of undefined while minifying packages/modules.js
   at ScopeTracker.addReference
   (C:\Users\edemaine\AppData\Local\.meteor\packages\zodern_standard-minifier-js\4.1.1\plugin.fastMinifier.os\npm\node_modules\meteor\babel-compiler\node_modules\babel-plugin-minify-mangle-names\lib\scope-tracker.js:47:34)

I tried upgrading zodern:standard-minifier-js, but that didn't fix anything.

I'm guessing the issue is the update to babel-compiler, but I can't downgrade because of other dependencies (e.g. accounts-base).

Having this exact same issue with 4.0.0

@zodern

@satyavh
Copy link

satyavh commented Mar 15, 2022

Confirmed exact same issue with METEOR@2.6.1
Suspecting the babel-compiler updates

@banjerluke
Copy link
Contributor

banjerluke commented May 4, 2022

Having this issue as well. Looks like it's related to (or is) babel/minify#556. It happens when some function in the code base has a parameter default value set to a constant:

const foo = 42;
function processAnswer(answer = 42) {
  // ...
}

Meteor 2.7's standard-minifier-js package doesn't choke on this. In my case, I was able to track down the source (a couple functions in a new NPM library I'd added, @rgossiaux/svelte-headlessui) and remove the offending code, so I get to keep my sourcemaps, at least for now...

Oddly I get it while minifying packages/modules.js

I got that too; I believe all NPM modules are concatenated into that file before being minified, so my guess is that the code that's tripping up Babel in your case is in an NPM library.

@znewsham
Copy link

Not to pile on, but I'm having the same issue - wildly it only happens in 1 of 6 very similarly structured apps, it complains about

"exceljs": "^4.2.0",
"graphiql": "^1.8.5",

but it clearly isn't just those modules that are a problem because when I tried to set up a repro with those modules + this minifier, it worked just fine, so there is for sure something else muddying the waters here

@banjerluke
Copy link
Contributor

Just in case anybody missed it, I created a PR (#31) that fixes the issue for me.

@DavidSichau
Copy link

@zodern Any chance that this could be fixed?

@zodern
Copy link
Owner

zodern commented Jul 25, 2023

#33 should fix these problems.

@zodern
Copy link
Owner

zodern commented Jul 25, 2023

Version 5 has been released.

@zodern zodern closed this as completed Jul 25, 2023
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

Successfully merging a pull request may close this issue.

9 participants