murdos / musicbrainz-userscripts

Collection of userscripts for MusicBrainz, by various authors
546 stars 91 forks source link

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

Open jmariani opened 2 weeks ago

jmariani commented 2 weeks ago

Running in Safari using userscripts extension

akritm commented 4 days 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 4 days 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 4 days 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 3 days ago

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

kellnerd commented 3 days ago

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

zas commented 2 days 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 2 days 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 2 days ago

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

zas commented 2 days 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.