Skip to content

SSR for Item pages is currently broken (9.0 only) #4145

@tdonohue

Description

@tdonohue

Describe the bug

Server Side Rendering is no longer working on Item pages. Item pages appear empty, and several errors appear in the server-side logs:

ERROR ReferenceError: customElements is not defined
    at Object.3161 (C:\dspace-angular\dist\server\2771.js:1:280894)
    at __webpack_require__ (C:\dspace-angular\dist\server\main.js:1:6545165)
    at Module.62771 (C:\dspace-angular\dist\server\2771.js:1:83167)
    at Function.__webpack_require__ (C:\dspace-angular\dist\server\main.js:1:6545165)
    at _ZoneDelegate.invoke (C:\dspace-angular\dist\server\main.js:1:4112854)
    at Object.onInvoke (C:\dspace-angular\dist\server\main.js:1:4694502)
    at _ZoneDelegate.invoke (C:\dspace-angular\dist\server\main.js:1:4112750)
    at ZoneImpl2.run (C:\dspace-angular\dist\server\main.js:1:4105427)
    at C:\dspace-angular\dist\server\main.js:1:4123762
    at _ZoneDelegate.invokeTask (C:\dspace-angular\dist\server\main.js:1:4113696)
GET /items/2aa94ec2-8ca5-44f2-b78b-c551f68e1dd9 200 419.938 ms - -
ERROR ReferenceError: Cannot access 'ROUTES' before initialization
    at Module.ROUTES (C:\dspace-angular\dist\server\2771.js:1:81890)
    at C:\dspace-angular\dist\server\main.js:1:7186606
    at _ZoneDelegate.invoke (C:\dspace-angular\dist\server\main.js:1:4112854)
    at Object.onInvoke (C:\dspace-angular\dist\server\main.js:1:4694502)
    at _ZoneDelegate.invoke (C:\dspace-angular\dist\server\main.js:1:4112750)
    at ZoneImpl2.run (C:\dspace-angular\dist\server\main.js:1:4105427)
    at C:\dspace-angular\dist\server\main.js:1:4123762
    at _ZoneDelegate.invokeTask (C:\dspace-angular\dist\server\main.js:1:4113696)
    at Object.onInvokeTask (C:\dspace-angular\dist\server\main.js:1:4694180)
    at _ZoneDelegate.invokeTask (C:\dspace-angular\dist\server\main.js:1:4113586)
GET /items/49d36364-d060-4835-a29a-8b30b4362ecb 200 447.707 ms - -

To Reproduce

Steps to reproduce the behavior

  1. Can be reproduced on either main branch locally or on Sandbox. To reproduce locally, you must run in production mode (e.g. npm run build:prod; npm run serve:ssr
  2. Find an Item or Publication, e.g. https://sandbox.dspace.org/entities/publication/a55c1182-44fd-4df2-8c41-21bfbf28e18f
  3. In your browser, disable Javascript.
  4. Reload the Item or Publication page. The page will appear empty. Only the DSpace header is visible
  5. If you are reproducing this on your local machine, you'll see SSR-related errors on the command prompt where you ran npm run serve:ssr

Expected behavior

Sandbox / 9.0 should behave the same as demo.dspace.org. This is not reproducible on demo.dspace.org.

Metadata

Metadata

Assignees

Labels

affects: mainIssue impacts "main" (latest release).bugcomponent: SEOSearch Engine Optimizationhigh prioritytestathonReported by a tester during Community Testathon

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions