When JS resources are batched in Confluence Data Center, the contents of each resource are wrapped in a try
block. This block seems to trigger this bug in Safari, which means ES6 code easily breaks with ReferenceError: can't find variable: x
. (This applies to the Closure-compiled code we use, but I don’t think it’s specific to Closure, it just happens that Closure tends to output functions/classes/etc as top-level declarations like this.)
(To be clear, the culprit here is definitely Safari. The resource batching used by Confluence just triggers the bug in Safari.)
Is there a way to disable batching for certain resources? Based on this answer, it doesn’t sound like there is, but it’s 2023 so “we have to support IE” is much less compelling than it was back then