Open MartinLoeper opened 6 years ago
I found out, that strict_mode causes this error.
This script seems not to work on NodeJs in strict_mode.
There are several variable declarations missing.
If someone is interested in how to get this library working in strict mode, please check out my fork: https://github.com/MartinLoeper/moment-holiday
@MartinLoeper are you planning to do a pull request to get your changes into this upstream repo (and thus, hopefully, into the NPM module)? I'd love to get these strict/minification issues resolved in the module to get my build working with less fuss.
For me, I had to move that variable declaration out to the top module scope to avoid minification errors. (https://github.com/bjhewitt/moment-holiday/commit/388ec0a573cdab20431868cb0892df70c5e287ca#diff-5ecd2a99d029816f5c37fce3481f99bd)
I provided the PR =)
However, I did not notice any minification errors. Everything worked well for the following command:
node_modules/.bin/gulp --name=moment-holiday-de.js --locale=Germany --locale=Easter --set=Germany --set=Easter
Thanks. I'm bundling and minifying numerous components together, so although moment-holiday is generating the error, it's possible there's something else at play. In any case, moving the variable declaration worked.
Hi, I'm getting the following error:
Any idea why this is happening?
I'm using NodeJs v8.4.0 on AWS with typescript compiler.
The library is included as follows: