Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: TypeError el.createShadowRoot is not a function (Safari/Edge) #6531

Closed
brendanalexdr opened this issue Jan 16, 2016 · 6 comments
Closed

Comments

@brendanalexdr
Copy link

Hi, I am grooming an angular2 app for publication. The app works great in chrome and safari, but not in Safari or Edge:

Here is a snippet of the error in safari:

TypeError el.createShadowRoot is not a function

And similarly in Edge:

Object doesn't support property or method 'createShadowRoot'

I have a question open on stackoverflow here: http://stackoverflow.com/questions/34824758/angular2-exception-typeerror-el-createshadowroot-is-not-a-function-safari-edge

Is there a shim or polymer that I need? Any help would be much appreciated!

@0x-r4bbit
Copy link
Contributor

This is because the browsers where the error is thrown don't support native ShadowDOM.

Did you reconfigure the view encapsulation? Because actually it defaults to "emulated" which doesn't rely on the native APIs.

@mhevery
Copy link
Contributor

mhevery commented Jan 20, 2016

Sounds like you are using native shadow DOM which is only available in Chrome.

@mhevery mhevery closed this as completed Jan 20, 2016
@zoechi
Copy link
Contributor

zoechi commented Jan 21, 2016

Loading the http://webcomponents.org/polyfills/ should make it work in other browsers as well

@BaamAadmi
Copy link

I am getting the same error on Firefox as well. What is the reason behind this? Is it because of following line?

encapsulation: ViewEncapsulation.None, //This is important to load any external styles

@zoechi
Copy link
Contributor

zoechi commented Jul 6, 2017

@BaamAadmi only if you are adding "external styles" to components.
If you add them to index.html, you don't need to change ViewEncapsulation

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants