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: i18n when using JSON in SSR - set reloadInterval: false #15297

Merged
merged 8 commits into from
Mar 8, 2022

Conversation

Platonn
Copy link
Contributor

@Platonn Platonn commented Mar 3, 2022

Previously, the periodical reloading of JSON translations in SSR was enabled by default by i18next-http-backend. The never-ending async task setInterval() invoked inside i18next-http-backend caused the SSR to hang.

To prevent it, we're setting explicitly reloadInterval: false in the options of i18next.

fixes #14372

@Platonn Platonn requested a review from a team as a code owner March 3, 2022 15:28
@Platonn Platonn temporarily deployed to dev March 3, 2022 15:28 Inactive
@Platonn Platonn changed the title fix: initialize propertly i18next when using JSON in SSR fix: fix i18n when using JSON in SSR Mar 3, 2022
@Platonn Platonn changed the title fix: fix i18n when using JSON in SSR fix: fix i18n when using JSON in SSR - set reloadInterval: false Mar 3, 2022
@cypress
Copy link

cypress bot commented Mar 3, 2022



Test summary

430 0 1 0Flakiness 3


Run details

Project spartacus
Status Passed
Commit 3a5ddbe ℹ️
Started Mar 8, 2022 9:58 AM
Ended Mar 8, 2022 10:05 AM
Duration 07:14 💡
OS Linux Ubuntu - 18.04
Browser Electron 91

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/ssr/pages.core-e2e-spec.ts Flakiness
1 SSR > should render homepage
2 SSR > should render PLP
3 SSR > should render PDP

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@Platonn Platonn temporarily deployed to dev March 7, 2022 12:40 Inactive
@Platonn Platonn temporarily deployed to dev March 7, 2022 15:20 Inactive
@Platonn Platonn temporarily deployed to dev March 8, 2022 09:47 Inactive
@Platonn Platonn changed the title fix: fix i18n when using JSON in SSR - set reloadInterval: false fix:x i18n when using JSON in SSR - set reloadInterval: false Mar 8, 2022
@Platonn Platonn changed the title fix:x i18n when using JSON in SSR - set reloadInterval: false fix:vi18n when using JSON in SSR - set reloadInterval: false Mar 8, 2022
@Platonn Platonn changed the title fix:vi18n when using JSON in SSR - set reloadInterval: false fix: i18n when using JSON in SSR - set reloadInterval: false Mar 8, 2022
@Platonn Platonn merged commit 063b5e5 into develop Mar 8, 2022
@Platonn Platonn deleted the feature/GH-14372 branch March 8, 2022 10:59
@Platonn Platonn temporarily deployed to dev March 8, 2022 10:59 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2022

Public API changes

✔️ Nothing changed in analyzed entry points.

⚠️ Some entry points are currently impossible to analyze.

Read more

💰 How to debug problems?

Read more

Platonn added a commit that referenced this pull request Mar 14, 2022
…ort to 4.3.x] (#15319)

Previously, the periodical reloading of JSON assets in SSR was enabled by default by `i18next-http-backend`. The never-ending async task `setInterval()` invoked inside `i18next-http-backend` caused the SSR to hang.

To prevent it, we're setting explicitly `reloadInterval: false` in the options of `i18next`.

fixes #14372

it's a backport of PR #15297 to 4.3.x
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.

JSON translations don't work in SSR Spartacus 4.x
2 participants