Skip to content

Conversation

@patrickarlt
Copy link

I'm working on a component library built with Stencil JS that is using focus trap and I ran into stenciljs/core#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