Skip to content

Incompatibilities introduced by dependency updates after regenerating package-lock.json #1801

@PKulkoRaccoonGang

Description

@PKulkoRaccoonGang

Description

After deleting and regenerating the package-lock.json file (using rm -rf node_modules package-lock.json && npm install), several issues appear:

  1. Jest reporter issue jest-console-group-reporter.

Errors occur when running tests:

TypeError: Cannot read properties of undefined (reading 'isSet')
    at SummaryReporter._getTestSummary (/Users/peterkulko/dev/tutor_workspaces/tutor-oex-main/src/frontend-app-learning/node_modules/@jest/reporters/build/index.js:1560:33)
    at SummaryReporter.onRunComplete (/Users/peterkulko/dev/tutor_workspaces/tutor-oex-main/src/frontend-app-learning/node_modules/@jest/reporters/build/index.js:1506:104)
    at JestConsoleGroupReporter.onRunComplete (/Users/peterkulko/dev/tutor_workspaces/tutor-oex-main/src/frontend-app-learning/node_modules/jest-console-group-reporter/dist/index.js:476:30)
    at ReporterDispatcher.onRunComplete (/Users/peterkulko/dev/tutor_workspaces/tutor-oex-main/src/frontend-app-learning/node_modules/@jest/core/build/ReporterDispatcher.js:71:24)
    at TestScheduler.scheduleTests (/Users/peterkulko/dev/tutor_workspaces/tutor-oex-main/src/frontend-app-learning/node_modules/@jest/core/build/TestScheduler.js:306:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runJest (/Users/peterkulko/dev/tutor_workspaces/tutor-oex-main/src/frontend-app-learning/node_modules/@jest/core/build/runJest.js:367:19)
    at async _run10000 (/Users/peterkulko/dev/tutor_workspaces/tutor-oex-main/src/frontend-app-learning/node_modules/@jest/core/build/cli/index.js:343:7)
    at async runCLI (/Users/peterkulko/dev/tutor_workspaces/tutor-oex-main/src/frontend-app-learning/node_modules/@jest/core/build/cli/index.js:198:3)
    at async Object.run (/Users/peterkulko/dev/tutor_workspaces/tutor-oex-main/src/frontend-app-learning/node_modules/jest-cli/build/run.js:130:37)
  1. Sass build warnings.
Image
  1. Paragon modal issues in tests.

Tests involving Paragon modals fail with the following errors:

TestingLibraryElementError: Unable to find an element by: [data-testid="modal-backdrop"]

...

TestingLibraryElementError: Unable to find an element with the title: test-modal-title.

...

TestingLibraryElementError: Unable to find an accessible element with the role "dialog"
  1. frontend-lib-special-exams test failures.

Tests fail due to issues with @openedx/frontend-plugin-framework mocks:

    TypeError: Cannot read properties of undefined (reading 'default')

      31 | jest.mock('@openedx/frontend-plugin-framework', () => ({
    > 32 |   ...jest.requireActual('@openedx/frontend-plugin-framework'),
         |           ^
      33 |   Plugin: () => 'Plugin',
      34 |   PluginSlot: MockedPluginSlot,
      35 | }));

      at printWarning (node_modules/react/cjs/react.development.js:209:30)
      at error (node_modules/react/cjs/react.development.js:183:7)
      at forwardRef (node_modules/react/cjs/react.development.js:1481:9)
      at Object.<anonymous> (node_modules/@openedx/frontend-plugin-framework/src/plugins/PluginSlot.jsx:132:30)
      at Object.require (node_modules/@openedx/frontend-plugin-framework/src/plugins/index.js:10:1)
      at Object.require (node_modules/@openedx/frontend-plugin-framework/src/index.js:1:1)
      at requireActual (src/setupTest.js:32:11)
      at Object.require (node_modules/@edx/frontend-lib-special-exams/src/plugin-slots/SubmittedTimedExamInstructionsSlot/index.jsx:3:1)
      at Object.require (node_modules/@edx/frontend-lib-special-exams/src/instructions/timed_exam/index.jsx:4:1)
      at Object.require (node_modules/@edx/frontend-lib-special-exams/src/instructions/EntranceInstructions.jsx:8:1)
      at Object.require (node_modules/@edx/frontend-lib-special-exams/src/instructions/index.jsx:17:1)
      at Object.require (node_modules/@edx/frontend-lib-special-exams/src/exam/Exam.jsx:8:1)
      at Object.require (node_modules/@edx/frontend-lib-special-exams/src/exam/ExamWrapper.jsx:5:1)
      at Object.require (node_modules/@edx/frontend-lib-special-exams/src/core/SequenceExamWrapper.jsx:2:1)
      at Object.require (node_modules/@edx/frontend-lib-special-exams/src/index.jsx:2:1)
      at Object.require (src/setupTest.js:14:1)

Additional information

#1753

Root Cause

The issue appears because after regenerating the package-lock.json file, newer versions of dependencies are installed due to the use of caret (^) ranges in package.json (e.g., "sass": "^1.79.3").
Some of these updated packages introduce breaking changes or incompatibilities with the current frontend-app-learning implementation.

It seems that if we decide to upgrade dependencies in the future, we’ll need to address the issues documented in this ticket to ensure compatibility and stability.

Metadata

Metadata

Labels

maintenanceRoutine upkeep necessary for the health of the platformneeds maintainer attentionIssue or PR specifically needs the attention of the maintainer.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions