• Plugin Author Thomas McMahon

    (@twistermc)


    If you just updated to PDFjs 2.2, and it’s no longer working, there’s a good chance your host needs to add support for JavaScript modules (mjs) files.

    To do this, you can try one of the following.

    • Add AddType application/javascript .mjs to your .htaccess file if you’re on an Apache server.
    • If you’re on a nginx server, open your mime-types.conf.hbs file and update application/x-javascript js; to application/x-javascript js mjs;
    • Contact your hosting support and ask them to add a mime type support for mjs files.

    I’m sorry for the headaches this change is causing. Unfortunately, this plugin is just a wrapper for Mozilla’s PDFjs, and they started using mjs files, which means we have to too.

Viewing 15 replies - 61 through 75 (of 97 total)
  • Plugin Author Thomas McMahon

    (@twistermc)

    New version is out! It no longer has the mjs requirements. Hopefully it works better for everyone.

    Doesn’t work for me. Win 7/64, Firefox 115.13.0esr, Google Chrome 109.0.5414.120 . I had to go back v.2.1.8.1

    mcyzyk

    (@mcyzyk)

    Still not working for me.

    Burt

    (@burt)

    @zemledelie, @mcyzyk,

    Could you please provide a little more information related to how this isn’t working for you? What happens when you load a page with a PDF embedded? Are there any error messages shown on the page? Are there specific errors or messages listed in the browser’s dev console?

    And perhaps, if possible, provide a link to a site that is failing.

    • This reply was modified 7 months ago by Burt.
    • This reply was modified 7 months ago by Burt.
    Plugin Author Thomas McMahon

    (@twistermc)

    If you’re still having issues, clear all caches, and provide a URL if you can.

    mcyzyk

    (@mcyzyk)

    Thanks, Burt!

    My original issue persists:

    I have a weird situation related to this:
    I have a Prod and a Dev server.
    In both, I’ve added the “AddType application/javascript .mjs” line to .htaccess.
    This solved my problem on Prod, but did not solve my problem on Dev. On Dev I get a “Forbidden. You don’t have permission to access this resource” error.
    File system permissions on Prod and Dev are identical.
    AND, on Dev, I CAN get directly to a PDF file via its URL.
    So for some reason, this plugin cannot get to it and is throwing an error. Don’t know why!

    MIME type added, cache cleared, trying with multiple browsers. Inspector sez: 403 Forbidden

    Again, weirdly, this is only on my Dev server, not Prod.

    Puzzled,

    Mark

    Plugin Author Thomas McMahon

    (@twistermc)

    403 Forbidden means that the plugin is trying to access a file that it doesn’t have access to. That file is publicly available in prod, so it’s not an issue. Changes are it’s the server trying to access something and it’s getting blocked.

    mcyzyk

    (@mcyzyk)

    I am able to get directly to the PDF file via its URL in the Media Library.

    Plugin Author Thomas McMahon

    (@twistermc)

    You are a person accessing a file via a browser. That’s different that the server trying to access the PDF on the server. It’s also harder to troubleshoot.

    mcyzyk

    (@mcyzyk)

    Got it! That may just be the Clue I need!

    Looking at server config more closely…

    https://zemledelie.org/wpm/shos-consp/shos-consp-01/

    After updating to version 2.2.1 it stopped working. No messages, just a blank window without a PDF document. You can watch it by following the link. I wrote the line in .htaccess and cleaned the browser. Look at the console if you can. I don’t understand anything there.

    Also I checked it in private window in FF

    Paddy Duncan

    (@paddy-duncan)

    @zemledelie – I just tried your link and the PDF loaded just fine for me in Chrome, Firefox Developer and Safari on a Mac. So I think maybe it’s a caching problem on your end.

    Burt

    (@burt)

    @zemledelie, the PDF at that link loads fine for me in Chrome and Firefox (Win64), as well as Chrome iOS. With this version, you shouldn’t need the extra line in .htaccess, but removing it is also not going to fix what’s not working for you. The issue appears to be local, perhaps a browser extension that’s causing a conflict, or perhaps a local cache that’s not been cleared fully.

    @burt Something strange. On the tablet with android 14 PDF works fine. On my desktop does not work in the FF or in chrome. Disabled all the extensions. Cache is clean as a mirror ?? still does not work …

    Here is a message from the console. It can be useful?

    parseFormData resource://gre/modules/WebRequestUpload.sys.mjs:401

    ?createFormData resource://gre/modules/WebRequestUpload.sys.mjs:447

    createRequestBody resource://gre/modules/WebRequestUpload.sys.mjs:547

    runChannelListener resource://gre/modules/WebRequest.sys.mjs:1000

    forEach self-hosted:2008

    runChannelListener resource://gre/modules/WebRequest.sys.mjs:933

    observe resource://gre/modules/WebRequest.sys.mjs:753

    applyFilter resource://gre/modules/ProxyChannelFilter.sys.mjs:414

        AsyncFunctionNext self-hosted:852

Viewing 15 replies - 61 through 75 (of 97 total)
  • The topic ‘?? PDFjs 2.2 Not Working?’ is closed to new replies.