TypeError: el.createShadowRoot is not a function
See original GitHub issueHi,
I’m trying to use your plugin in an Ionic 2 app.
Unfortunately, I get a TypeError: el.createShadowRoot is not a function
I searched on this and found this link that talk about EncapsulationView
and I saw that you recently introduce this in your code.
So I tried to use it for my @Page component but same thing happened.
If I remove the directives: [NotificationsComponent]
the error disappears but the notifications don’t work.
So I’m not sure if the issue is related to this library or the ionic framework…
PS :
In the readme, it says directives: [NotificationComponent]
and in sample it’s directives: [NotificationsComponent]
so it could be helpful to rename the class as @sialcasa suggested.
UPDATE :
With ViewEncapsulation.Native
, I get a blank page with previous error in Firefox and Safari. For Chrome, my page is displayed with broken CSS and I get a TypeError: Cannot convert undefined or null to object in [ {{ "pick_photo_button" | translate }}
.
With ViewEncapsulation.Emulated
, all 3 browsers displays the previous Chrome behavior.
So apparently, there is a conflict with ng2-translate plugin too.
Not sure if it’s all clear…
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (7 by maintainers)
Top GitHub Comments
@flauc @Fenkiou ViewEncapsulation.Native uses native Shadow Dom API that isn’t supported by other browsers then chrome yet. But there is a polyfill for it: http://webcomponents.org/polyfills/
Ah - I saw you prefixed your CSS classes - this is a good solution!