question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: el.createShadowRoot is not a function

See original GitHub issue

Hi,

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 EncapsulationViewand 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:closed
  • Created 8 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sialcasacommented, Mar 9, 2016

@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/

0reactions
sialcasacommented, Mar 10, 2016

Ah - I saw you prefixed your CSS classes - this is a good solution!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError el.createShadowRoot is not a function (Safari/Edge ...
I faced the same issue recently, got this error on Firefox el.createShadowRoot is not a function. From the documentation, I learned that ...
Read more >
TypeError el.createShadowRoot is not a function (Safari/Edge ...
Hi, I am grooming an angular2 app for publication. The app works great in chrome and safari, but not in Safari or Edge:...
Read more >
Angular2 Exception: TypeError el.createShadowRoot is not a ...
Angular2 Exception: TypeError el.createShadowRoot is not a function (Safari/Edge). angular. I have an angular2 app that works great in Chrome and Firefox, ...
Read more >
Element.createShadowRoot() - Web APIs - MDN Web Docs
Use Element.createShadowRoot to create an instance of shadow DOM. When shadow DOM is created, it is always attached to an existing element.
Read more >
TypeError el.createShadowRoot is not a function (Safari/Edge ...
Coding example for the question Angular2 Exception: TypeError el.createShadowRoot is not a function (Safari/Edge)-angular.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found