Topic on Module talk:TNT

Not-so-helpful "helpful error" message

3
Rwv37 (talkcontribs)

Trying to set up a MediaWiki-based site, and (apparently foolishly) am trying to get preexisting templates working on it. One problem I'm running into is that in (for example) Template:Ambox, this module complains:

Lua error in Module:TNT at line 158: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Documentation.tab.

Upon first seeing this, I installed the JsonConfig extension. The behavior did not change at all. After quite some time spent trying to figure out what was going on, I decided to actually look at the code, and found:

-- Give helpful error to thirdparties who try and copy this module.
if not mw.ext or not mw.ext.data or not mw.ext.data.get then
error('Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:' .. dataset)
end

So, apparently this "helpful error" message is not merely not-terribly-helpful, but at least in some cases, it's actively misleading. It should not say "Missing JsonConfig extension"... unless that actually is the problem, which, in my case, I do not believe it is.

I assume that that was referring to the "mw.ext" check, which is probably passing for me, and the failure I'm getting is in either mw.ext.data or mw.ext.data.get. Unfortunately, I don't even have any idea what this module is for or what it's trying and failing to do here -- all I know is that it's breaking Template:Ambox (among others), so I don't know for sure. But I figured I should point out this issue with the "helpful error" in any case. -Rwv37 (talk) 10:12, 17 January 2022 (UTC)

Rwv37 (talkcontribs)

Incidentally, in case anyone has this same problem in the future, I just found this thread, in which User: Tacsipacsi's response worked for me. -Rwv37 (talk) 10:27, 17 January 2022 (UTC)

Ciencia Al Poder (talkcontribs)
Reply to "Not-so-helpful "helpful error" message"