Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

minification (?) causes error in gulp build process #15

Open
bjhewitt opened this issue Sep 25, 2017 · 3 comments
Open

minification (?) causes error in gulp build process #15

bjhewitt opened this issue Sep 25, 2017 · 3 comments

Comments

@bjhewitt
Copy link

I'm having an issue when code is compiled and minified via gulp / browserify / babelify / gulp-uglify

Uncaught TypeError: Cannot read property 'united_states' of undefined, at:

p = function(t) { if (regions = t.split("/"), t = regions[0].toLowerCase().replace(" ", "_"), regions.shift(), !s.holidays[t]) try { var r = "./locale/"; "build" == n.split("/").slice(-1).pop() && (r = "." + r), e(r + t) } catch (s) {} return !!s.holidays[t] && (regions.length ? u(t, regions) : s.holidays[t]) }

in moment-holiday-us.min.js

It works fine with the same build process if I tell browserify not to minify via options, which skips gulp-uglify. Any thoughts on what could be going on?

@heinst
Copy link

heinst commented Apr 23, 2018

Im having the same issue...did you ever get it resolved?

@martinmurciego
Copy link

This command:
gulp --name=moment-holiday-ar.js --locale=Argentina --locale=Easter --set=Argentina --min
Cause:

Error: Cannot find module 'yargs'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object. (/home/martin/Descargas/moment plugin rangos intervalos y dias habiles/unzipped/moment-holiday-master/gulpfile.js:1:74)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)

@desi
Copy link

desi commented Dec 9, 2019

This is more of an FYI for you but this also happens when using the uglifier gem inside a rails project. If you tell uglifier not to mangle the variable names it doesn't happen. Hope that is helpful to someone.

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

No branches or pull requests

4 participants