Closed ryancat closed 4 years ago
Did you declare jquery as a dependency for timezonejs in your browserify shim?
@bcherny no -- there is npm version of jquery which I don't have to use browserify shim.
I don't mean shim jquery, but shim timezoneJS. So in your package.json:
"browserify-shim": {
"./node_modules/timezonejs/timezone.js": {
"exports": "timezonejs",
"depends": [ "./node_modules/jquery/jquery.js:$" ]
}
}
see https://github.com/thlorenz/browserify-shim#a-config-inside-packagejson-without-aliases
Does PR #159 fix this? Can we close this issue?
When use browserify in front end code:
There are js uncought error in console says: "Uncaught Error: Please use the Fleegix.js XHR module, jQuery ajax, Zepto ajax, or define your own transport mechanism for downloading zone files. "
This is due to the 'this' variable used in src/date.js is an empty object if using browserify to require 'timezone-js'. A simple PR would be instead:
use
See https://github.com/mde/timezone-js/pull/159