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

ripple: HTMLElement is not defined on SSR #581

Closed
4cm4k1 opened this issue Dec 31, 2018 · 6 comments
Closed

ripple: HTMLElement is not defined on SSR #581

4cm4k1 opened this issue Dec 31, 2018 · 6 comments

Comments

@4cm4k1
Copy link
Contributor

4cm4k1 commented Dec 31, 2018

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! 😄

@moog16
Copy link
Contributor

moog16 commented Jan 2, 2019

Thanks for opening the issue..SSR isn't something we're setup for testing, but i'm sure a lot of people out there are using it. Please open PR if you have time.

I also opened issue #588 since you're the 4th issue regarding SSR.

@4cm4k1
Copy link
Contributor Author

4cm4k1 commented Jan 2, 2019

Hey @moog16, happy New Year! I’ll get to work on a PR. Shouldn’t take too long. Regarding SSR generally, I’ll also look into how RMWC goes about testing against SSR use cases and add what I learn to #588 (not sure about an ETA for this part, though).

@moog16
Copy link
Contributor

moog16 commented 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.

@4cm4k1
Copy link
Contributor Author

4cm4k1 commented Jan 4, 2019

As promised, PR submitted! 😉 (First one closed because I forgot to create a new non-master branch.)

@moog16
Copy link
Contributor

moog16 commented Jan 4, 2019

Thanks :)

@moog16
Copy link
Contributor

moog16 commented Jan 4, 2019

closing as #592 was merged. Thanks again!

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

No branches or pull requests

2 participants