musicbrainz-userscripts icon indicating copy to clipboard operation
musicbrainz-userscripts copied to clipboard

[discogs] ReferenceError: Can't find variable: MBLinks

Open jmariani opened this issue 1 year ago • 9 comments

Running in Safari using userscripts extension

jmariani avatar Oct 06 '24 19:10 jmariani

Same for me in Chrome tampermonkey. And I see errors in console:

 @require: couldn't load @require from URL 'lib/mbimport.js': internal error
 @require: couldn't load @require from URL 'lib/logger.js': internal error
 @require: couldn't load @require from URL 'lib/mblinks.js': internal error
 @require: couldn't load @require from URL 'lib/mbimportstyle.js': internal error
chrome-extension://d…5d8-9caa96c2eb3d:49 Uncaught (in promise) ReferenceError: MBLinks is not defined
    at Proxy.<anonymous> (userscript.html?name…-9caa96c2eb3d:49:17)
    at Pt (<anonymous>:10:89)
    at userscript.html?name…8-9caa96c2eb3d:1:88
    at window.__f__m2c9s3xc.rco (userscript.html?name…-9caa96c2eb3d:1:355)
    at Pt (<anonymous>:10:89)
    at r.setMessageListener.r (<anonymous>:86:186)
    at <anonymous>:89:107
    at _ (<anonymous>:22:406)

Seems like external libs stopped working for some reason in userscript manager. @require instruction just don't load them.

akritm avatar Oct 16 '24 14:10 akritm

Same for me in Chrome tampermonkey. And I see errors in console:

 @require: couldn't load @require from URL 'lib/mbimport.js': internal error
 @require: couldn't load @require from URL 'lib/logger.js': internal error
 @require: couldn't load @require from URL 'lib/mblinks.js': internal error
 @require: couldn't load @require from URL 'lib/mbimportstyle.js': internal error
chrome-extension://d…5d8-9caa96c2eb3d:49 Uncaught (in promise) ReferenceError: MBLinks is not defined
    at Proxy.<anonymous> (userscript.html?name…-9caa96c2eb3d:49:17)
    at Pt (<anonymous>:10:89)
    at userscript.html?name…8-9caa96c2eb3d:1:88
    at window.__f__m2c9s3xc.rco (userscript.html?name…-9caa96c2eb3d:1:355)
    at Pt (<anonymous>:10:89)
    at r.setMessageListener.r (<anonymous>:86:186)
    at <anonymous>:89:107
    at _ (<anonymous>:22:406)

Seems like external libs stopped working for some reason in userscript manager. @require instruction just don't load them.

fyi - temporary solved it changing to direct paths to github in tampermonkey script e.g.:

// @require        https://raw.githubusercontent.com/murdos/musicbrainz-userscripts/refs/heads/master/lib/mbimport.js
// @require        https://raw.githubusercontent.com/murdos/musicbrainz-userscripts/refs/heads/master/lib/logger.js
// @require        https://raw.githubusercontent.com/murdos/musicbrainz-userscripts/refs/heads/master/lib/mblinks.js
// @require        https://raw.githubusercontent.com/murdos/musicbrainz-userscripts/refs/heads/master/lib/mbimportstyle.js

akritm avatar Oct 16 '24 16:10 akritm

I got this issue with Bandcamp Importer and TamperMonkey 5.3.1 (deployed on 2024-10-16), relative links ceased to work (with similar errors on console).

zas avatar Oct 17 '24 09:10 zas

See https://github.com/murdos/musicbrainz-userscripts/pull/581

zas avatar Oct 17 '24 13:10 zas

Upstream issue report: https://github.com/Tampermonkey/tampermonkey/issues/2201

kellnerd avatar Oct 18 '24 10:10 kellnerd

So, either we merge this to avoid this recurring issue, or we wait for upstream fix and hope it doesn't happen again. I would prefer the second option, because relative require makes much more sense for a library (and, as said, it works better with branches).

@kellnerd what do you think?

zas avatar Oct 18 '24 11:10 zas

I totally agree. Let's hope the upstream issue gets solved fast, there were already two more issue reports (one on GitHub, one on the forums) since you opened the PR yesterday.

kellnerd avatar Oct 18 '24 11:10 kellnerd

Is there a way that users could fix this manually until there's an update?

psychoadept avatar Oct 18 '24 18:10 psychoadept

Is there a way that users could fix this manually until there's an update?

Yes, at least with TamperMonkey one can edit the file directly. But that's not really convenient for most users.

zas avatar Oct 18 '24 18:10 zas

The bug has been fixed in Tampermonkey 5.3.2

kellnerd avatar Nov 09 '24 10:11 kellnerd

So the solution is to upgrade to Tampermonkey 5.3.2 or higher and reinstall the broken userscripts (per the upstream issue comment).

kellnerd avatar Nov 15 '24 21:11 kellnerd