TypeError: Cannot read property 'nativeElement' of undefined

PDF.js Express Version

Detailed description of issue
On loading pdf js express viewer element we are getting an error.

Expected behaviour
{Provide a screenshot or description of the expected behaviour}

Link to document
{Provide a link to the document in question if possible}

Code snippet

@ViewChild(‘viewer’, { static: true }) viewer: ElementRef;
WebViewer({
disableFlattenedAnnotations: true,
path: ‘…/…/wv-resources/lib’,
config: ‘…/…/wv-resources/lib/ui/config/file.js’, // relative to your HTML file
disabledElements: [
‘selectToolButton’, ‘toolbarGroup-Edit’, ‘toolsHeader’, ‘searchButton’, ‘header’,
‘panToolButton’, ‘toggleNotesButton’, ‘notesPanel’, ‘menuButton’, ‘highlightToolGroupButton’, ‘underlineToolGroupButton’, ‘strikeoutToolGroupButton’, ‘stickyToolGroupButton’, ‘freeHandToolGroupButton’,
‘toolsOverlay’, ‘viewControlsButton’, ‘leftPanelButton’, ‘toolbarGroup-Insert’, ‘toolbarGroup-Shapes’, ‘squigglyToolGroupButton’, ‘freeTextToolGroupButton’,
],
initialDoc: ‘assets/schedules-pdf/sample_01.pdf’

}, this.viewer.nativeElement).then(instance => {

  const utils = new ExpressUtils();

  const { Annotations, Tools, annotManager, docViewer } = instance;
  // set pdf to full width of viewer
  instance.setFitMode(instance.FitMode.FitWidth);
})

Hi there!

The error suggests that this.viewer is undefined. This would be an error in your code and not related to PDF.js Express, so unfortunately I cannot be of much help here.

Thanks!
Logan