ripple: HTMLElement is not defined on SSR
See original GitHub issueHello,
With the changeover to TS in v0.8.0
, the following line went from being scoped within a function to not:
const MATCHES = util.getMatchesProperty(HTMLElement.prototype);
In SSR React apps, this will result in an HTMLElement is not defined
error, because it’s not evaluated in a browser where HTMLElement
would exist.
The following line, when added just before the line above, resolves the issue locally:
const HTMLElement = typeof HTMLElement === 'undefined' ? function () {} : HTMLElement;
However, I’m not sure this is an appropriate solution outside of my use case. If this addition would suffice, I can submit a PR for it. Let me know! Thanks! 😄
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Angular 9 and SSR - window is not defined - Stack Overflow
I solved this problem as follows: I, probably like many, do not really need this component when rendering on the server.
Read more >react-use-ripple - npm
A react hook to create material design ripples for components. ... There are no other projects in the npm registry using react-use-ripple.
Read more >HTMLElement is not defined for Custom Element? | Velo by Wix
I'm attempting to add a custom element to my site, however anytime I add an element, I get the following console error: ReferenceError: ......
Read more >v-overlay API - Vuetify
name type default
absolute boolean false
activator string | Element | ComponentPublicInstance undefined
attach string | boolean | Element false
Read more >UDN Search - UDN Web Docs: MDN Backup
the end tag may be omitted if the <html> element is not immediately ... recommendation html 5.1the definition of 'readonly attribute' in that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
sweet! ya don’t worry too much about exploring how RMWC tests SSR. I will be looking into…eventually. I need to meet with the team to see where it fits into 2019.
closing as #592 was merged. Thanks again!