reactjs

HandleError in React


how to fix "Uncaught TypeError: Failed to fetch dynamically imported module: http://cdnjs.cloudflare.com/ajax/libs/pdf.js/4.4.168/pdf.worker.min.js at handleError (http://localhost:3000/static/js/bundle.js:284680:58) at http://localhost:3000/static/js/bundle.js:284699:7"


Solution

  • The link appears to be incorrect. Analyzing the source I found the following: https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.6.347/pdf.worker.min.js

    Apparently, the correct way to access is to use https, instead of http.