Page MenuHomePhabricator

Exception in module-execute in module ext.CodeMirror
Closed, DuplicatePublic

Description

[Note: Cannot reproduce.]
I clicked "Edit source", no toolbar loaded, and this error in browserconsole:

Exception in module-execute in module ext.CodeMirror:  load.php:176:15
TypeError: $(...).wikiEditor is not a function TypeError: $(...).wikiEditor is not a function
Stack trace:
[object Object]  load.php:176:53
	logError https://test.wikipedia.org/w/load.php:176:53
	handler https://test.wikipedia.org/w/load.php:154:832
	fire https://test.wikipedia.org/w/load.php:45:104
	fireWith https://test.wikipedia.org/w/load.php:46:431
	fire https://test.wikipedia.org/w/load.php:46:474
	track https://test.wikipedia.org/w/load.php:154:614
	runScript/< https://test.wikipedia.org/w/load.php:161:301
	fire https://test.wikipedia.org/w/load.php:45:104
	add https://test.wikipedia.org/w/load.php:45:656
	always https://test.wikipedia.org/w/load.php:46:865
	runScript https://test.wikipedia.org/w/load.php:160:944
	checkCssHandles https://test.wikipedia.org/w/load.php:161:678
	cssHandle/< https://test.wikipedia.org/w/load.php:161:808
	fire https://test.wikipedia.org/w/load.php:45:104
	fireWith https://test.wikipedia.org/w/load.php:46:431
	fire https://test.wikipedia.org/w/load.php:46:474
	fireCallbacks https://test.wikipedia.org/w/load.php:156:320
	addEmbeddedCSS https://test.wikipedia.org/w/load.php:156:661
	addEmbeddedCSS/cssBufferTimer< https://test.wikipedia.org/w/load.php:156:538

Screenshot at 2017-07-08 11-17-15.png (1×1 px, 243 KB)

Event Timeline

Sounds like a missing dependency upon jquery.wikiEditor or something?

Such hard-to-reproduce bug report is like a diamond, thank you for testing and well describing.
Seems problem is in $( addCodeMirrorToWikiEditor );
The addCodeMirrorToWikiEditor function should be called after wikiEditor loaded. (should make sure that wikiEditor loaded).
This is really hard-to-reproduce.

So, when mw.loader.getState( 'ext.wikiEditor') is loaded, you immediately initialise right ?
I think you are dropping into the timing hole between loading of ext.WikiEditor and the actual toolbar module executing... This whole wikiEditor loading is a disaster for sure :(

Seems there is a hook that are called when Toolbar initialized, I am not sure...

I think this task is a duplicate of T169943: Syntax highlighting has occasional toolbar errors and if so, https://gerrit.wikimedia.org/r/#/c/364324/ might have fixed it. Let's wait for another bug report on this.

Yes, that looks like the same thing.