-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[React] ssr ReferenceError: document is not defined #21209
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
Conversation
When using react output generated components do not work in ssr (like Next.js) because generated component try to use document without safety checking if document exists. default function parameters values of built in globals is not a good pattern to use when SSR support is a goal of the project, so can you https://www.youtube.com/watch?v=4gYZsCm5blA :)
…t support IntersectionObserve (ionic-team#21222)
…onic-team#21276) updates breakpoint max to reduce the max width by 0.02px closes ionic-team#20993 closes ionic-team#20743
…ionic-team#21283) - improves the documentation on customizing scoped overlays using cssClass and/or CSS variables - includes a section in the Angular usage with information on where the CSS needs to be styled (globally) in order to work for an overlay
…onic-team#21170) * fix(input): check for tabindex and pass it properly to native input references ionic-team#17515 * style(input): fix lint error * test(input): update test for more use cases (inside item) * fix(item): adds delegatesFocus to shadow * style(input): add comment block on what the code does
5.1.1
This reverts commit cc780c8.
…nic-team#21333) Co-authored-by: Stefanos Anagnostou <[email protected]>
…individual styling (ionic-team#21304) Co-authored-by: Robb Wright <[email protected]>
* chore: internal import updates to improve bundling - Rename keyboard.ts so it has a good filename after custom element bundling - Import util fns directly instead of from top level index - Do not export with * * chore(angular): bump ng-packagr Co-authored-by: Mike Hartington <[email protected]>
inherits alignment in inner item, sets item alignment to center fixes ionic-team#18703
Thanks for the PR! Can you fix the failing test? |
in node.js document is undefined so "Expression is always false." tslint error is false.
I fixed all the failing tests that I could, only one is left |
Try syncing your branch with the latest |
…into fix-react-ssr-ReferenceErrors
done, all tests pass now. |
Hmm since you forked Ionic, it looks like you will need to a) sync your fork's This StackOverflow answer gives a pretty good walkthrough of how to do it: https://stackoverflow.com/questions/7244321/how-do-i-update-a-github-forked-repository Or if it's easier, just refork from Ionic and copy your changes over so you have the latest changes in Ionic. |
Apologies for the delay. It looks like this issue was resolved when we shipped our I am going to close this PR, but feel free to open an issue if you run into any other problems with SSR. Thanks! |
When using react output generated components do not work in ssr (like Next.js) because generated component try to use document without safety checking if document exists.
default function parameters values of built in globals is not a good pattern to use when SSR support is a goal of the project, so can you https://www.youtube.com/watch?v=4gYZsCm5blA :)
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
ReferenceError: document is not defined
when SSRingIssue Number: N/A
What is the new behavior?
no
ReferenceError: document is not defined
Does this introduce a breaking change?
Other information