https://discord.umbraco.com logo
I think the problem lies in your
# package-development
n
I think the problem lies in your Manifest. We had some ideas and thoughts on making it possible to write a HTML Template directly in the Manifest but never something we prototyped or got to investigate further. So I think that would be the first thing to adjust. The
element
property of your Modal Manifest, has to be either a JS Class of the Web Component, or a path to the file holding that. Otherwise you can use
elementName
set it to a string containing the name of element you like to use. (just notice in this case that element needs to be loaded/registered by something else). In other words, this is not valid to my knowledge: element: html`...` I would recommend this: element: () => import('./the-file-name.js'), Notice this needs the element to be exported as
default
or
element
(as seen in the referenced tutorial
export const element = MyDialogElement;
) This is the alternative: elementName: 'urltracker-redirect-name-of-your-element'
r
Hi Niels, Thanks for the reply! In my earlier testing, which I have re attempted just now, I also tried the other approaches you are describing. However none of them seem to work for me. Something that might be relevant is that when I use the recommended approach, I get a type error on the
ManifestModal
type:
Copy code
javascript
Type '() => Promise<typeof import("<PATH_TO_FILE>/simpleRedirect-main.lit")>' is not assignable to type 'ElementLoaderProperty<UmbModalExtensionElement<any, any, ManifestModal> | UmbModalExtensionElement<any, never, ManifestModal> | UmbModalExtensionElement<...>> | undefined'.
Could that be relevant? I have tried to export it both as
default
and as
element
(not at the same time). https://cdn.discordapp.com/attachments/1436301872595075152/1436305665739194409/image.png?ex=690f1f63&is=690dcde3&hm=6a58578ebc0abc5f311c9f0d7e2e8240c5c6a288d1705e4eef4ff676d96ac029&
p
Can you show the file that you are linking to?
n
Since you are extending the Modal Base class, I dont see why you have implemented the method marked with red, just get rid of them. They are implemented in the base class.Same goes with modalContext and manifest. It is already defined. Also it look like the two redirect Service things in the top are provided using Lit Context API. Thats not what we use, so switch that out to use the Umbraco Context API. But for the test of it, just delete everything but your render method, that should work and then you can build you custom stuff from there. Good luck
And by the way, you dont need to bring your own version of Lit, we have exposed our version for you, which can be imported via
@umbraco-cms/backoffice/external/lit
18 Views