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

fix(web): improve Proxy check to avoid SSR problems #2851

Merged
merged 3 commits into from
May 21, 2020
Merged

fix(web): improve Proxy check to avoid SSR problems #2851

merged 3 commits into from
May 21, 2020

Conversation

flogy
Copy link
Contributor

@flogy flogy commented Apr 30, 2020

Fixed #2850

Solves server rendering issues by checking if window is actually defined (which is not the case when doing server rendering).

@xzilja
Copy link
Contributor

xzilja commented May 1, 2020

Just verified this with capacitor / nextjs build, all good 👍

@jabczyk
Copy link

jabczyk commented May 9, 2020

I ran across the same issue when using Capacitor and Gatsby.
After this change Gatsby's SSR works perfectly fine.
Please approve it in the next update, as it delays my deployment.

@xzilja

This comment has been minimized.

Copy link
Contributor

@imhoffd imhoffd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be more portable.

core/src/web-runtime.ts Outdated Show resolved Hide resolved
Co-authored-by: dwieeb <[email protected]>
@jcesarmobile jcesarmobile changed the title fix(web): Check if in browser before using window variable fix(web): improve Proxy check for avoiding SSR problems May 21, 2020
@jcesarmobile jcesarmobile changed the title fix(web): improve Proxy check for avoiding SSR problems fix(web): improve Proxy check to avoid SSR problems May 21, 2020
@jcesarmobile jcesarmobile merged commit 7afc9eb into ionic-team:master May 21, 2020
@fildidi
Copy link

fildidi commented May 25, 2020

@IonicProSupport When should we expect this fix to be released? Because currently im having the same issue with Nuxt js, where Im on 'universal' mode, where since the first page need to be served from the server, the window is not defined.
It is for a site, which is suppose to go live within a week, so I urgently need this fix released, so we can us it
Do you have a time frame in mind, on when can that happen?

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.

bug: window is not defined when using server rendering
7 participants