cancel
Showing results for 
Search instead for 
Did you mean: 

UI5 task transpile error - Typescript

arunmbarec
Participant
0 Kudos

screenshot-2023-07-09-at-011212.png

screenshot-2023-07-09-at-011234.png

Dear Community Members,

I am trying to learn to build ui5 applications using typescript. While trying to execute the application, i ended up with the following error and require your help. In the Component.ts file, i have used ES6 class and when i build, I expected the build file to be something like "UIComponent.extend("ui5.typescript.Component", {".

But instead, i see the code still compiled to "class Component extends UIComponent {"

While executing the code i see the below error.

Log-dbg.js:493 2023-07-09 01:03:39.670899 Failed to load component for container container - TypeError: Class constructor Component cannot be invoked without 'new'  
TypeError: Class constructor Component cannot be invoked without 'new'
Here is a reference to my github code.

https://github.com/arunkrishnamoorthy/piapproval/tree/main

Note: Here i generated the app from BAS wizard and modified the .ts file and added the required dependencies. I tried the same example in the VS Code using yo easy-ui5 and everything worked fine.

View Entire Topic
arunmbarec
Participant
I have this problem solved. I added this namespace in the Component.ts file, then the Component.js was transpiled as expected. 
/**
* @namespace testyo
*/