Skip to content

yarn build:mirador fails on 8.4 — BlueprintJS version incompatible with React 16 #5802

@ErenCim

Description

@ErenCim

Describe the bug

When upgrading to DSpace Angular 8.4, running yarn build:mirador fails during the build pipeline. This happens because the build process runs yarn add @blueprintjs/core @blueprintjs/icons without specifying a version, which pulls in BlueprintJS v6.15.0.

These newer BlueprintJS packages require React 18, but DSpace Angular 8.4 natively uses React 16.14.0. This mismatch causes the build to crash due to missing React APIs (react-dom/client, react/jsx-runtime, useId, and useSyncExternalStore).

Error Logs:

WARNING in ./node_modules/@blueprintjs/core/lib/esm/components/overlay2/overlay2.js 502:15-20
export 'useId' (imported as 'useId') was not found in 'react'

WARNING in ./node_modules/@blueprintjs/core/lib/esm/hooks/overlays/useLegacyOverlayStack.js 47:18-38
export 'useSyncExternalStore' (imported as 'useSyncExternalStore') was not found in 'react'

ERROR in ./node_modules/@blueprintjs/core/lib/esm/components/context-menu/contextMenuSingleton.js 18:0-46
Module not found: Error: Can't resolve 'react-dom/client' in '/app/node_modules/@blueprintjs/core/lib/esm/components/context-menu'

ERROR in ./node_modules/@blueprintjs/core/lib/esm/components/toast/overlayToaster.js 19:0-46
Module not found: Error: Can't resolve 'react-dom/client' in '/app/node_modules/@blueprintjs/core/lib/esm/components/toast'

ERROR in ./node_modules/@floating-ui/react/dist/floating-ui.react.mjs 3:0-56
Module not found: Error: Can't resolve 'react/jsx-runtime' in '/app/node_modules/@floating-ui/react/dist'

webpack 5.106.2 compiled with 3 errors and 2 warnings in 16855 ms

To Reproduce

Environment Context:

  • DSpace Angular version: 8.4 (tag dspace-8.4, commit 8d1244e)
  • Node version: 22.22.3
  • Yarn version: 1.22.22
  • React version: 16.14.0

Steps to reproduce the behavior:

  1. docker pull dspace/dspace-angular:dspace-8.4
  2. docker run -it --entrypoint sh dspace/dspace-angular:dspace-8.4
  3. yarn add @blueprintjs/core @blueprintjs/icons
  4. yarn build:mirador

Expected behavior

The yarn build:mirador command should compile successfully without breaking changes or missing peer dependency errors. The installed versions of @blueprintjs/core and @blueprintjs/icons should be pinned or restricted to versions that are backward-compatible with DSpace Angular's React 16.14.0 environment.

Related work

This issue was discovered during an upgrade of the Scholaris Service while attempting to transition from DSpace 8.3 to 8.4 with BUILD_MIRADOR=true enabled in the GitLab CI configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects: 8.xIssue impacts 8.x releasesbugdependenciesPull requests that update a dependency filehelp wantedNeeds a volunteer to claim to move forwardhigh priority

    Type

    No fields configured for Bug.

    Projects

    Status
    📋 To Do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions