Hi all,
We are experiencing an issue with Server-Side Rendering (SSR) in our new
DSpace 7.6.1 deployment. The frontend was built using yarn build:prod and
is served with PM2 in cluster mode, proxied by Apache ( standard procedure
<https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-FrontendInstallation>
).
While the application generally works, SSR fails and falls back to
client-side rendering. The PM2 logs show the following persistent error:
2025-07-30 12:24:27 +02:00: Error in server-side rendering (SSR)
2025-07-30 12:24:27 +02:00: Error details : Error: ENOENT: no such file or
directory, open 'dist/server/assets/i18n/en.json'
at Object.openSync (node:fs:601:3)
at readFileSync (node:fs:469:35)
at TranslateServerLoader.getTranslation
(/xxxxxxxx/dspace-angular/dist/server/main.js:1:7841654)
at TranslateService.getTranslation
(/xxxxxxxx/dspace-angular/dist/server/main.js:1:2544266)
at TranslateService.retrieveTranslations
(/xxxxxxxx/dspace-angular/dist/server/main.js:1:2544114)
at TranslateService.use
(/xxxxxxxxx/dspace-angular/dist/server/main.js:1:2543648)
at ServerLocaleService.setCurrentLanguageCode
(/xxxxxxxxx/dspace-angular/dist/server/main.js:1:803671)
at ServerInitService.initI18n
(/xxxxxxxxxx/dspace-angular/dist/server/main.js:1:7852325)
at ServerInitService.<anonymous>
(/xxxxxxxxx/dspace-angular/dist/server/main.js:1:7854044)
at Generator.next (<anonymous>) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: 'dist/server/assets/i18n/en.json'
}
2025-07-30 12:24:27 +02:00: Falling back to serving direct client-side
rendering (CSR).
I've checked the path dspace-angular/dist/server/assets/i18n/, and the
error is correct: the file en.json doesn't exist. Instead, the build
process has generated files with hashes for cache-busting, like:
-
en.d332cb3fe482394367781784743548fd.json
-
en.json5
It seems the server-side application is hardcoded to look for en.json, but
the build process creates a hashed version.
Has anyone encountered this mismatch? Is there a specific configuration in
angular, PM2 or config.prod.yml that I need to adjust to make SSR correctly
resolve the paths to these hashed asset files?
I haven't found any clues about this specific pathing issue online. Any
pointers would be greatly appreciated.
Regards.
--
All messages to this mailing list should adhere to the Code of Conduct:
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/dspace-tech/c2297693-a4fd-4c68-a250-720a0aa11027n%40googlegroups.com.