You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Easeljs and requireJS: performance is not defined #758
When I load Easel with RequireJS I get an error at line 1381: var now = window.performance && (performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow);
performance is not defined
What is the cause of this? Am I forgetting to load another dependency?
It is possible that RequireJS is wrapping EaselJS in a closure, that it doesn't have access to performance when it is not defined as window.performance. Can you modify the EaselJS source to always say window.performance, and see if it still happens? If that solves it, we can make a fix in EaselJS. We are also welcome to pull-requests :)
With my current project, I'm working in Node-webkit, which is based on Chromium. So by all accords it should be working (I guess). But I fixed it, by adding window. on the perfomance instances, as you suggested. Thanks for the help :) !
Looks like your find/replace got a little too aggressive. I've fixed this for Ticker (performance), but looking at your pull request it appears this is also an issue for document, which is a more extensive change. I'll leave this open and come back to it shortly.
Activity
lannymcnie commentedon Apr 16, 2016
The performance class is a standard API in all modern browsers. What browser/system are you using that causes this error?
It is possible that RequireJS is wrapping EaselJS in a closure, that it doesn't have access to
performancewhen it is not defined aswindow.performance. Can you modify the EaselJS source to always saywindow.performance, and see if it still happens? If that solves it, we can make a fix in EaselJS. We are also welcome to pull-requests :)skroink commentedon Apr 16, 2016
With my current project, I'm working in Node-webkit, which is based on Chromium. So by all accords it should be working (I guess). But I fixed it, by adding
window.on theperfomanceinstances, as you suggested. Thanks for the help :) !lannymcnie commentedon Apr 16, 2016
Cool. Sounds like something that should be added to EaselJS.
Cheers.
Fixed an issue where accessing performance throws an error in node we…
gskinner commentedon Apr 6, 2017
Looks like your find/replace got a little too aggressive. I've fixed this for Ticker (
performance), but looking at your pull request it appears this is also an issue fordocument, which is a more extensive change. I'll leave this open and come back to it shortly.