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.

ripple: HTMLElement is not defined on SSR

See original GitHub issue

Hello,

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:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
moog16commented, Jan 2, 2019

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.

0reactions
moog16commented, Jan 4, 2019

closing as #592 was merged. Thanks again!

Read more comments on GitHub >

github_iconTop 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 >

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