Ionic 4 document viewer error

#1

I replicate the same exact code from the documentation.

openDoc() {
  const options: DocumentViewerOptions = {
    title: 'My PDF'
  }

  this.document.viewDocument('assets/myFile.pdf', 'application/pdf', options)
}

The error I received

#2

Solution:

Requires absolute path e.g. file:///… . not supported for relative…