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

call define conditionally #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patrickarlt
Copy link

I'm working on a component library built with Stencil JS that is using focus trap and I ran into ionic-team/stencil#1782 trying to setup prerendering with Stencil. When Stencil prerenders it loads the focus trap code and dies on the call to window.customElements.define which doesn't exist.

Fortunately it is pretty easy to avoid this by wrapping the window.customElements.define call in a check to make sure window.customElements exists first. This solves the issue with prerendering with Stencil so I decided to make a PR.

@patrickarlt patrickarlt changed the title call define conditiionally call define conditionally Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant