Getting error in ui.frontend while deploying AEM Code

Viewed 145

Created AEM code base using artifact 35. Deployment is failing in ui.frontend module. the The node version and npm version in the pom are v12.22.7 and 6.14.0 respectively.
Below is the error log.

INFO] 1170:47-54
[INFO] [tsl] ERROR in C:\Users\shaku\workspace\code\aemnote\ui.frontend\node_modules\@types\express-serve-static-core\index.d.ts(1170,48)
[INFO]       TS1005: ';' expected.
[INFO] ts-loader-default_e3b0c44298fc1c14
[INFO]
[INFO] ERROR in C:\Users\shaku\workspace\code\aemnote\ui.frontend\node_modules\@types\express-serve-static-core\index.d.ts
[INFO] 1186:15-19
[INFO] [tsl] ERROR in C:\Users\shaku\workspace\code\aemnote\ui.frontend\node_modules\@types\express-serve-static-core\index.d.ts(1186,16)
[INFO]       TS1005: ';' expected.
[INFO] ts-loader-default_e3b0c44298fc1c14
[INFO]
[INFO] ERROR in C:\Users\shaku\workspace\code\aemnote\ui.frontend\node_modules\@types\express-serve-static-core\index.d.ts
[INFO] 1187:32-40
[INFO] [tsl] ERROR in C:\Users\shaku\workspace\code\aemnote\ui.frontend\node_modules\@types\express-serve-static-core\index.d.ts(1187,33)
[INFO]       TS1005: ';' expected.
[INFO] ts-loader-default_e3b0c44298fc1c14
[INFO]
[INFO] ERROR in C:\Users\shaku\workspace\code\aemnote\ui.frontend\node_modules\@types\express-serve-static-core\index.d.ts
[INFO] 1255:0
[INFO] [tsl] ERROR in C:\Users\shaku\workspace\code\aemnote\ui.frontend\node_modules\@types\express-serve-static-core\index.d.ts(1255,1)
[INFO]       TS1160: Unterminated template literal.
[INFO] ts-loader-default_e3b0c44298fc1c14
[INFO]
[INFO] 2022-09-16 17:34:30: webpack 5.74.0 compiled with 127 errors and 2 warnings in 9791 ms
[INFO] npm ERR! code ELIFECYCLE
[INFO] npm ERR! errno 1
[INFO] npm ERR! aem-maven-archetype@1.0.0 prod: `webpack --config ./webpack.prod.js && clientlib --verbose`
[INFO] npm ERR! Exit status 1
[INFO] npm ERR!
[INFO] npm ERR! Failed at the aem-maven-archetype@1.0.0 prod script.
[INFO] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[INFO]
[INFO] npm ERR! A complete log of this run can be found in:
[INFO] npm ERR!     C:\Users\shaku\AppData\Roaming\npm-cache\_logs\2022-09-16T09_34_30_503Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for AEM Note 1.0.0-SNAPSHOT:
[INFO]
[INFO] AEM Note ........................................... SUCCESS [  0.598 s]
[INFO] AEM Note - Core .................................... SUCCESS [ 11.538 s]
[INFO] AEM Note - UI Frontend ............................. FAILURE [ 16.205 s]
[INFO] AEM Note - Repository Structure Package ............ SKIPPED
[INFO] AEM Note - UI apps ................................. SKIPPED
[INFO] AEM Note - UI content .............................. SKIPPED
[INFO] AEM Note - UI config ............................... SKIPPED
[INFO] AEM Note - All ..................................... SKIPPED
[INFO] AEM Note - Integration Tests ....................... SKIPPED
[INFO] AEM Note - UI Tests ................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  31.725 s
[INFO] Finished at: 2022-09-16T17:34:30+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.0:npm (npm run prod) on

project aemnote.ui.frontend: Failed to run task: 'npm run prod' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [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/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :aemnote.ui.frontend

Please help me to resolve this error.

1 Answers

This looks like a problem with Express and an incompatible version of TypeScript. As far as I can tell, the archetype (version 35) uses TypeScript 3.

A similar issue was reported on the archetype's GitHub for version 37 of the archetype just 4 days ago. A few commenters say they fixed it by upgrading to TypeScript 4. There hasn't been a new version since then and the issue is still open so I would suggest watching that thread. If the TypeScript version bump fixes this, there's probably going to be a pull request shortly.

Related