question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Uncaught (in promise): TypeError: Cannot read property 'read' of null

See original GitHub issue

Hello, first time submitting an issue for this library!

I am seeing this error in the console anytime I change the value of src through input binding.

TypeError: Cannot read property 'read' of null
    at pump (pdf.js:18960)
    at pdf.js:18973
    at ZoneDelegate.invoke (zone-evergreen.js:359)
    at Object.onInvoke (core.js:30892)
    at ZoneDelegate.invoke (zone-evergreen.js:358)
    at Zone.run (zone-evergreen.js:124)
    at zone-evergreen.js:855
    at ZoneDelegate.invokeTask (zone-evergreen.js:391)
    at Object.onInvokeTask (core.js:30873)
    at ZoneDelegate.invokeTask (zone-evergreen.js:390)
    at resolvePromise (zone-evergreen.js:797)
    at zone-evergreen.js:862
    at ZoneDelegate.invokeTask (zone-evergreen.js:391)
    at Object.onInvokeTask (core.js:30873)
    at ZoneDelegate.invokeTask (zone-evergreen.js:390)
    at Zone.runTask (zone-evergreen.js:168)
    at drainMicroTaskQueue (zone-evergreen.js:559)

Here’s the basic setup I have:

<input #file type="file" (change)="updateFile(file)">

<div *ngIf="pdfSrc" class="pdf-viewer-container">
    <p>Preview</p>
    <ngx-extended-pdf-viewer 
    [src]="pdfSrc" 
    [useBrowserLocale]="true" 
    height="250px"
    zoom="25%"
    [showSidebarButton]="false"
    [showFindButton]="false"
    [showPagingButtons]="false"
    [showZoomButtons]="false"
    [showPresentationModeButton]="false"
    [showOpenFileButton]="false"
    [showPrintButton]="false"
    [showDownloadButton]="false"
    [showBookmarkButton]="false"
    [showSecondaryToolbarButton]="false"
    delayFirstView=1000>
    </ngx-extended-pdf-viewer>
</div>

When the value of pdfSrc changes, I see the error above in the console. The PDF still changes however!

How do I change the file being displayed without this error being printed?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
00benallencommented, Jun 17, 2019

Hey Staphranauh, sorry busy weekend. I will try to send you a reproducer by the end of this work week!

0reactions
stephanrauhcommented, Jul 18, 2019

Let’s close the ticket. I suppose it’s like you, @g3344, say: it used to be a common bug, but I’ve managed to solve it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >
Uncaught (in promise) TypeError: Cannot read property 'style ...
All this error means is that the property you are trying to edit, in this case the element with an id "box_2_info_" +...
Read more >
How to deal with TypeError: cannot read properties of null
This common error occurs when one tries to read a property or call a method on a null object. For Safari users, this...
Read more >
Uncaught (in promise) TypeError: Cannot read property 'error ...
Uncaught (in promise ) TypeError: Cannot read property 'error' of null. I'm using Vue.js / Algolia to power the search on my site....
Read more >
Getting Runtime error : Uncaught (in promise): TypeError ...
Getting Runtime error : Uncaught (in promise): TypeError: Cannot read property 'rating' of null TypeError: Cannot read property 'rating' of null ; Platform....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found