Documentation | Creating UI | Templates | Sub-Templates (Example not working) V24

message.txt (19.5 KB)

I don’t know where the error started, but I copied part of it before repeating the same thing (the error is repeated approximately every 5 seconds)

How did you create the app?

a standard project from the tutorial, to which I did not add anything, I only tested all the functionality coming sequentially from the documentation (I deleted, changed, added something)

Can you share it?

I’ll do it now

https://github.com/Alienn-Know/error

vite v5.0.12 building for production...
transforming...
✓ 188 modules transformed.
frontend/src/parent-template.ts(6,13): error TS1434: Unexpected keyword or identifier.

It looks like you are mixing Java and typescript code

This are the content of your typescript file

@Tag("parent-template")
@JsModule("./com/example/parent-template.ts")
public class ParentTemplate extends LitTemplate {

    @Id("childTemplate")
    private ChildTemplate child;
}

this is Java code

Sorry a little, this is not exactly the code in which the errors occurred, I just deleted everything, now I’ll try to send the version in which the errors occurred

I’ll fix it now and send new version

I changed it a little, but now there is another error, I don’t know how to repeat the error that was before

in the parent-template file I added “import ‘child-template.js’;” to “import ‘child-template.ts’;”

@JsModule(“./src/parent-template.ts”) @JsModule(“./src/child-template.ts”) replaced “com/example” in Java files component

and added constructor in Java Components

frontend/src - ts files, com/example/application/component - Component files Java

It looks like there’s a mistake in the docs,.The import of r’child-template.js` should be relative

import './child-template.js`