PDF.js version: 3.5.141

These two properties should be marked as not mandatory as they are initialized if not present
if (this._scrollMode !== ScrollMode.PAGE) {
      throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");
    }
    const pageNumber = this._currentPageNumber,
      state = this.#scrollModePageState,
      viewer = this.viewer;
    
    viewer.textContent = "";
    
    state.pages.length = 0;
    if (this._spreadMode === SpreadMode.NONE && !this.isInPresentationMode) {
      
      const pageView = this._pages[pageNumber - 1];
      viewer.append(pageView.div);
      state.pages.push(pageView);
    } else {
      const pageIndexSet = new Set(),
        parity = this._spreadMode - 1;
      
      if (parity === -1) {
        
        pageIndexSet.add(pageNumber - 1);
      } else if (pageNumber % 2 !== parity) {