Error disappears by updating any HTML element on the fusion gen page.

Source: https://perchance.org/fusion-ai-image-generator

Dynamic imports plugin: https://perchance.org/dynamic-import-plugin

I let name = localStorage.name , if it exists ,

when running dynamicImports(name).

I didn’t have this error when I implemented the localStorage thingy.

So I suspected this to be connected to some new added feature for dynamic Imports.

Ideas on solving this?

Code when I select names for dynamic import upon start (the error only occurs upon opening/reloading the page) :

_generator
    gen_danbooru
        fusion-t2i-danbooru-1
        fusion-t2i-danbooru-2
        fusion-t2i-danbooru-3

    gen_lyrics
        fusion-t2i-lyrics-1
        fusion-t2i-lyrics-2

...

_genKeys
    gen_danbooru
    gen_lyrics

...

// Initialize
getStartingValue(type) =>
  _genKeys.selectAll.forEach(function(_key) {
    document[_key] = 'fusion-t2i-empty';
    if (localStorage.getItem(_key) && localStorage.getItem(_key) != '' && localStorage.getItem(_key) != 'fusion-t2i-empty') {
      document[_key] = localStorage.getItem(_key);
    } else {
      document[_key] = [_generator[_key].selectOne];
      localStorage.setItem(_key, document[_key]);
    };
  });

...

  dynamicImport(document.gen_danbooru, 'preload');  

...

if (type == "danbooru"): return document.gen_danbooru; 
}; 

// End of getStartingValue(type)

...

_folders
  danbooru = dynamicImport(document.gen_danbooru || getStartingValue("danbooru")) 

  • wthit56@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    4 days ago

    You should use the dev tools in your browser to figure this out. In the sources tab of dev tools, turn on “break on caught error” and see if you can get to the line that looks like that one it printed out in that message. That’ll help you figure out what code is breaking.

    Presumably it’s in the dynamic importer plugin, so you could just look in that plugin’s code on the site, and see where that is, and find out what’s gone wrong that way.