Page MenuHomePhabricator

Global script is not loaded on debug=true
Closed, ResolvedPublicBUG REPORT


Steps to Reproduce:

The JavaScript from is loaded and executed.

  • Load a page in a WMF project with URL parameter debug=true.

Actual Results:

The JavaScript from is not loaded.

Expected Results:

The JavaScript from is loaded and executed.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I confirmed this by replacing my global.js by console.log( 'Started global.js.' ); and then loading
There should be a log in the console, but it was not there.

The top-level call is calling out to Meta, which seems fine:

Output HTML
meta - ext.globalCssJs.user
mw.loader.implement( "ext.globalCssJs.user@4bfqw", [
] );

Once on meta, it is using a relative url for the inner call (only=scripts). This is expanded relative to the current browser tab, so ends up not working due to looking on the local wiki.

Interestingly, if you were to make the top-level call on a local instead:, then it does make the inner call with an absolute URL to Meta:

ptwiki - ext.globalCssJs.user
mw.loader.implement( "ext.globalCssJs.user@4bfqw", [
] );

So there are two ways forward:

  • Change the top-leval call to be for the local wiki instead of Meta. From there, we already produce a full url to Meta.
  • Keep the top-level url for Meta, But change the inner one to be a full url, even when serving the top-level from Meta.

I suspect one or both of these were different before, and a recent change may've disconnected those dots.

Krinkle triaged this task as Low priority.EditedJun 15 2020, 7:50 PM
Krinkle moved this task from Inbox to Confirmed Problem on the MediaWiki-ResourceLoader board.

Note to self: The module url is determined based on the module source.

Change 714664 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] resourceloader: Fix debug mode for RL-to-RL cross-wiki module loads

Change 714664 merged by jenkins-bot:

[mediawiki/core@master] resourceloader: Fix debug mode for RL-to-RL cross-wiki module loads

I'll verify when it rolls out next week.