ace editor causing errors

564 views
Skip to first unread message

matt

unread,
Mar 5, 2018, 12:53:32 AM3/5/18
to Ajax.org Cloud9 Editor (Ace)
i have recently come across these error messages ocurring together in sequence
copied from chrome console

ace.js:10276 Uncaught TypeError: Cannot read property 'row' of undefined
    at EditSession.$computeWidth (ace.js:10276)
    at EditSession.getScreenWidth (ace.js:10248)
    at VirtualRenderer.$getLongestLine (ace.js:17864)
    at VirtualRenderer.$computeLayerConfig (ace.js:17758)
    at VirtualRenderer.$renderChanges (ace.js:17639)
    at VirtualRenderer.onResize (ace.js:17319)
    at Array.<anonymous> (ace.js:17139)
    at Text.EventEmitter._signal (ace.js:4162)
    at Text.<anonymous> (ace.js:15661)
    at exports.FontMetrics.EventEmitter._emit.EventEmitter._dispatchEvent (ace.js:4146)
ace.js:15265 Uncaught TypeError: Cannot read property 'className' of undefined
    at Gutter.update (ace.js:15265)
    at VirtualRenderer.$renderChanges (ace.js:17664)
    at VirtualRenderer.onResize (ace.js:17319)
    at Array.<anonymous> (ace.js:17139)
    at Text.EventEmitter._signal (ace.js:4162)
    at Text.<anonymous> (ace.js:15661)
    at exports.FontMetrics.EventEmitter._emit.EventEmitter._dispatchEvent (ace.js:4146)
    at exports.FontMetrics.checkForSizeChanges (ace.js:16605)
    at ResizeObserver.<anonymous> (ace.js:16613)
ace.js:9851 Uncaught TypeError: Cannot read property 'length' of undefined
    at EditSession.getTokenAt (ace.js:9851)
    at new TokenIterator (ace.js:6688)
    at ace.js:13174
ace.js:15265 Uncaught TypeError: Cannot read property 'className' of undefined
    at Gutter.update (ace.js:15265)
    at VirtualRenderer.$renderChanges (ace.js:17664)
    at ace.js:16526
ace.js:15265 Uncaught TypeError: Cannot read property 'className' of undefined
    at Gutter.update (ace.js:15265)
    at VirtualRenderer.$renderChanges (ace.js:17697)
    at ace.js:16526

i am using only ace.js from src-noconflict, i just downladed the latest version from github today

i seem to recall having similar issues surrounding this error in the past, it seems to be caused by my code somehow,
previously i found an error in my code and it solved the issue, im bug hunting this one now, but im wondering how
my code is able to affect the editor in this way

thanks,matt

Harutyun Amirjanyan

unread,
Mar 5, 2018, 5:20:19 AM3/5/18
to ace-d...@googlegroups.com
I don't know what could cause this kind of error.
Could you share the relevant part of your code or create a simple page reproducing the error?

matt

unread,
Mar 5, 2018, 9:46:26 PM3/5/18
to Ajax.org Cloud9 Editor (Ace)
hi harutyun,

i have found the offending line and created a codepen illustrating the error, it boils down to this erroneous piece of code :

          Array.prototype.unshift(arguments,'arbitrary string');

the line in my program was in a statement for debugging and was designed to prepend the module name before calling debugfn.apply(null,arguments) like this

function debug(){
   Array.prototype.unshift(arguments,'modulename');
  debugfn.apply(null,arguments);
}

ok i was writing this very quickly just to explain why i was using this rough construct :-o, the line "should" read Array.prototype.unshift.CALL(arguments,'modulename') should one so wish

anyways the codepen url demonstrating all this as succinctly as i can is :


it errs in chrome,firefox and edge

ace is a wonderful editor, thankyou harutyun for all your hardwork

matt


Reply all
Reply to author
Forward
0 new messages