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

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`

but I didn’t understand how, we have a ts file and not js

image.png

thanks, it works now

import js or ts does it do the same or are there any special differences?

It works for me this way and that way

You can take a look at this page to understand how modulre resolution is supposed to work