murdos / musicbrainz-userscripts

Collection of userscripts for MusicBrainz, by various authors
554 stars 92 forks source link

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

Closed jmariani closed 1 week ago

jmariani commented 1 month ago

Running in Safari using userscripts extension

akritm commented 1 month ago

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 commented 1 month ago

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
zas commented 1 month ago

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 commented 1 month ago

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

kellnerd commented 1 month ago

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

zas commented 1 month ago

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?

kellnerd commented 1 month ago

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.

psychoadept commented 1 month ago

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

zas commented 1 month ago

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.

kellnerd commented 2 weeks ago

The bug has been fixed in Tampermonkey 5.3.2

kellnerd commented 1 week ago

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