I tried this multiple times and also checked how the frontend.x.php files are enqueued and i couldn’t find anything on them that checks for the visibility of the modules etc.
I made little walkthrough on how to check this, for this I used the post grid and set it to never show.
(this is my first post so I could only post 1 image it looks like, rest should be in the comments)
If you where to call the FLBuilderPostGrid() you are able to locate the js assets connected to this module when editing, and you can then see the output of the frontend.js.php:
(see comment with #2 for screenshot)
As a reference, this is the frontend.js.php code for the post grid module, and you can see the same code here without the “real” data:
(see comment with #3 for screenshot)
Now, the appearance of the “issue”. If you now go and save the post and try to do the same, by calling the function to see where its located in the code, and then search for the node ID, you can still see the js from this module without the module being rendered (querySelector is returning null)
(see comment with #4 for screenshot)
I couldn’t find anything related to this with a quick search, so I thought to give it a post here