I'm writing a P2 plugin for Confluence. This code transforms a .js file on the fly using the Web Resource Transformer. Everything works absolutely perfectly in a barely-configured developer plugin instance (created from running `atlas-debug`), but when I connect to a real staging server (highly configured & customized with many plugins). Version numbers don't seem to be an issue, since if I match the staging servers' version numbers, I observe the same result. But in any case, I've tried with both 7.19.8 and 7.13.7.
On the development environments, I see something like this:
/* module-key = 'confluence.extra.jira:web-resources', location = 'templates/extra/jira/jiraIssues.js' */
{code...}
;
On the two staging servers, I observed identical behavior:
try{
/* module-key = 'confluence.extra.jira:web-resources', location = 'templates/extra/jira/jiraIssues.js' */
{code...}
}catch(e){WRMCB(e)};
;This try/catch code block is repeated for each of the scripts that are being compiled (100s of times). The issue I see is that on the staging servers, `}catch(e){WRMCB(e)}` to close out the try/catch block never comes, so it fails. I want to find out what is generating these try/catch code blocks to see if I can find some reference or perhaps even support, but my searches so far are coming up empty.
Here is the relevant portion of the atlassian-plugin.xml
<web-resource key="js-transform-javascript">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<transformation extension="js">
<transformer key="js-transformation" />
</transformation>
<resource type="download" name="/js/js-mod.js" location="/js/js-mod.js" />
<context>atl.general</context>
</web-resource>
<web-resource-transformer key="js-transformation" class="com.example.app.jsTransformer" />
Two final notes: when I examine the failing code, I can observe that the correct transformation has taken place. And when I manually append the closing code fragment, the javascript loads without errors:
}catch(e){WRMCB(e)};
;