You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In node.js environment we don't get navigator object - pdfjs-dist makes a decision based on the presence of navigator object i.e. if present it tries to access navigator.platform.<methods> which is reasonable.
When used with detectrtc it gets the navigator object (polyfill), as a result it goes and tries to access methods on platform property but since platform itself is unavailable, calling any method on top of it throws error.
detectrtc
when used withpdfjs-dist
in node.js environment produces an error due to incomplete polyfill for navigator in thedetectrtc
.Error
Cause of error
In node.js environment we don't get navigator object -
pdfjs-dist
makes a decision based on the presence of navigator object i.e. if present it tries to accessnavigator.platform.<methods>
which is reasonable.When used with
detectrtc
it gets the navigator object (polyfill), as a result it goes and tries to access methods onplatform
property but sinceplatform
itself is unavailable, calling any method on top of it throws error.Reference
pdfjs-dist
- navigator does not contain platform, therefore require('pdfjs-dist/build/pdf') leads to an error mozilla/pdf.js#15728DetectRTC/DetectRTC.js
Line 31 in a8e07fd
DetectRTC/DetectRTC.js
Line 72 in a8e07fd
pdfjs-dist
The text was updated successfully, but these errors were encountered: