Suddenly, syntax errors occur whenever packaging is performed

Hello everyone.

Sources that were previously built without problems through atlas-package have recently caused syntax errors.

This is an add-on for Datacenter Jira.

Here is the error syntax:

atlas-package
[INFO] Project POM found
[INFO] Resolving plugin info, may take a while on the first run.
[INFO] Project defined AMPS version detected: 8.0.1
Executing: /opt/homebrew/Cellar/atlassian-plugin-sdk/8.2.7/libexec/apache-maven-3.5.4/bin/mvn package -gs /opt/homebrew/Cellar/atlassian-plugin-sdk/8.2.7/libexec/apache-maven-3.5.4/conf/settings.xml
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< kr.osci.atlas.customapps:sscard-jira-sso >--------------
[INFO] Building sscard-jira-sso 1.0.1
[INFO] --------------------------[ atlassian-plugin ]--------------------------
[WARNING] The artifact jta:jta:jar:1.0.1b has been relocated to javax.transaction:jta:jar:1.0.1B
[INFO]
[INFO] --- jira-maven-plugin:8.0.1:compress-resources (default-compress-resources) @ sscard-jira-sso ---
[INFO] Compiling javascript using YUI
[ERROR] missing ) after argument list
	    return new Promise(async function(resolve, reject) {
[ERROR] missing ; before statement
	        let msg = await flexibleUserLicesneCheck(checkUrl);
[ERROR] missing ; before statement
	        let validFlag = false;
[ERROR] missing ; before statement
	            let successMsg = {
[ERROR] syntax error
	                type: 'success',
[ERROR] syntax error
	                body: 'Flexible User License가 정상적으로 설치되어있습니다.',
[ERROR] syntax error
	                close: 'auto'
[ERROR] missing ; before statement
	            let errorMsg = {
[ERROR] syntax error
	                type: 'error',
[ERROR] syntax error
	                body: 'Flexible User License가 설치되어 있지 않습니다.',
[ERROR] syntax error
	                close: 'auto'
[ERROR] syntax error
	    })
[ERROR] missing ) after argument list
	    return new Promise(async function(resolve, reject) {
[ERROR] missing ; before statement
	        let entity = await getActiveSsoEntity();
[ERROR] missing ; before statement
	        let flag = entity.activeFlag;
[ERROR] syntax error
	    })
[ERROR] missing ) after argument list
	    return new Promise(async function(resolve, reject) {
[ERROR] missing ; before statement
	        let entity = await getActiveSsoEntity();
[ERROR] missing ; before statement
	                let successMsg = {
[ERROR] syntax error
	                    type: 'success',
[ERROR] syntax error
	                    body: 'Flexible User License 설정이 정상적으로 저장되었습니다.',
[ERROR] syntax error
	                    close: 'auto'
[ERROR] missing ; before statement
	                let errorMsg = {
[ERROR] syntax error
	                    type: 'error',
[ERROR] syntax error
	                    body: 'Flexible User License 설정이 정상적으로 저장되지 않았습니다.',
[ERROR] syntax error
	                    close: 'auto'
[ERROR] syntax error
	    })
[ERROR] missing ; before statement
	                let errorMsg = {
[ERROR] syntax error
	                    type: 'error',
[ERROR] syntax error
	                    body: 'Flexible User License가 정상적으로 설치되어 있지 않습니다.',
[ERROR] syntax error
	                    close: 'auto'
[ERROR] Compilation produced 31 syntax errors.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.130 s
[INFO] Finished at: 2023-10-19T16:49:56+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.atlassian.maven.plugins:jira-maven-plugin:8.0.1:compress-resources (default-compress-resources) on project sscard-jira-sso: Execution default-compress-resources of goal com.atlassian.maven.plugins:jira-maven-plugin:8.0.1:compress-resources failed: Compilation produced 31 syntax errors. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

If anyone can help, I would really appreciate it.

Newer syntax is just not supported by YUI compressor and it fails in non-deterministic ways AFAIK. The rule of thumb is if you use tools like Webpack or if you’re using newer syntax like Arrow Symbols then you should not use YUI compressor. There’s not much out there officially about this but there’s old posts like this : How to Compress ES6 files with maven for an Jira P...

Thank you for answer.
If you use the promise await function, a syntax error will occur.
I first changed this problem to a callback method, but can you recommend a better method?

You should probably use frontend-maven-plugin in your POM and transpile your code to whatever version of EcmaScript is supported, or minify it without YUI (there are plenty oftools that you can use: Webpack, Vite…).
You can also set <compressResources> to false to just skip the YUI compressor step: any modern browser will support promises, there’s no reason to go back to the dark days of callbacks :slight_smile: