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

When "/reload/" paths are not enabled for SSR, sometimes i18n language pack fails to load #3934

Closed
tdonohue opened this issue Jan 31, 2025 · 0 comments · Fixed by #3935
Closed
Assignees
Labels
affects: main Issue impacts "main" (latest release). bug high priority
Milestone

Comments

@tdonohue
Copy link
Member

tdonohue commented Jan 31, 2025

Describe the bug

This issue is related to #3682.

In my local development environment, I've encountered a scenario where after authenticating, sometimes SSR briefly turns off and then back on again. When SSR turns off, this can result in language packs not loading properly. Strangely, I cannot seem to reproduce this on sandbox.dspace.org, but the behavior is consistent in my local environment.

Here's what I'm doing:

  1. Running latest main code as of Jan 31 for both frontend & backend
  2. Starting frontend in Production mode: npm run build:prod; npm run serve:ssr
  3. Visiting the homepage
  4. Immediately logging in as any user

After login, in the logs for server-side rendering (where you ran npm run serve:ssr), I'm seeing this when the login occurs:

Universal off, serving for direct client-side rendering (CSR)
GET /reload/1738353823478 200 1.632 ms - 751
GET /home 200 947.703 ms - -

(The message "Universal off" is only triggered when SSR is disabled while the "server.ts" code is run)

After login, the homepage will load up without any i18n translations. Here's an example of what the header looks like:

Image

The issue appears to be with the ssr.paths setting. It MUST include the /reload/ path (which is triggered after login to perform a hard refresh). When /reload/ is added to the configuration, I no longer see this odd behavior.

ssr:
  paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/', '/reload/' ]

I'll submit a PR to all three branches shortly to fix this issue.

Related work

Related to #3682

@tdonohue tdonohue added affects: main Issue impacts "main" (latest release). bug high priority labels Jan 31, 2025
@tdonohue tdonohue added this to the 7.6.3 milestone Jan 31, 2025
@tdonohue tdonohue self-assigned this Jan 31, 2025
@tdonohue tdonohue moved this from 📋 To Do to 🏗 In Progress in DSpace 9.0 Release Jan 31, 2025
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in DSpace 9.0 Release Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: main Issue impacts "main" (latest release). bug high priority
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant