You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had the same problem with Angular, the problem is that the bundlers of the Frameworks remove the unused imports, and the component depends on executing the define static method of the component.
The solution is to use the default export somewhere to force the bundler to include the component code.
Example in Angular syntax:
importRelativeTimeElementfrom'@github/relative-time-element'
@Component({selector: 'my-component',imports: [],template: '<relative-time [attr.datetime]="myDate">April 1, 2024</relative-time>',schemas: [CUSTOM_ELEMENTS_SCHEMA]})exportclassMyComponent{myDate=newDate()constructor(){// Logs the default export to include the code...console.log(RelativeTimeElement)}}
Activity
jdgaravito commentedon Jan 24, 2025
this is the only way I made it work, but is because is making a call to github to download it wich is not performance friendly,
tried something like
or using as a module
and i had no luck.
Heyner128 commentedon Feb 12, 2025
I had the same problem with Angular, the problem is that the bundlers of the Frameworks remove the unused imports, and the component depends on executing the
definestatic method of the component.The solution is to use the default export somewhere to force the bundler to include the component code.
Example in Angular syntax: