Closed sandeshds closed 7 years ago
The issue is coming from the very first lines of the module (moment-precise-range.js):
if (typeof moment === "undefined" && require) {
The error goes away if we replace it with:
if (typeof moment === "undefined" && typeof require === 'function') {
I tried this out locally, and it works perfectly. It also retains the intended purpose of checking for require's existence: to ensure it can be called.
I've created a PR for it: #23
fixed by @andfaulkner
I have been using it as an npm package and using the version '1.2.1'. I see that there is no new version that has been published. Are we planning to publish the new version with the fix ?
npm now at version 1.2.4 which includes latest fixes
Getting this error while importing "moment-precise-range-plugin". I believe it is caused due to the following statement
if (typeof moment === "undefined" && require) { moment = require('moment'); }
changing it to
if (typeof moment === "undefined") { moment = require('moment'); }
fixes the issue. Is there a workaround or fix to this ?