• 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 - 1 through 15 (of 97 total)
  • The original nginx configuration is application/javascript js;. Should I replace it with application/x-javascript js mjs; or should I add a new line for the new MIME type?

    Plugin Author Thomas McMahon

    (@twistermc)

    application/x-javascript js mjs;? should work. You shouldn’t need a new line.

    The new plugin has some issues with browser compatibility. In a newly installed system windows 10, I tested it using Chrome 125.0.6422.142 and Edge 125.0.2535.92. Chrome can display PDFs normally, but Edge cannot. Note that the Chrome and Edge versions I mentioned are also newly installed.

    Plugin Author Thomas McMahon

    (@twistermc)

    Chrome and Edge are based on the same rendering engine, so not sure why this would be. Do you get any errors?

    I have made changes to .htacess and mime types (using ngnix). Still does not work.

    Plugin Author Thomas McMahon

    (@twistermc)

    nginx doesn’t use .htaccess. If you have an nginx server, you have to update the nginx config files.

    @usainds

    Actually, the configuration has already taken effect, but you need to clear your browser’s cache. The most convenient way to test this is to install a new browser or use a new device to access it. I also struggled with this for a long time due to the cache. However, some browsers still won’t work even after clearing the cache, and they are not as compatible as the previous js scripts.

    • This reply was modified 5 months, 2 weeks ago by zhangweibo.

    I did update the nginix config file mime-types.conf.hbs

    @usainds

    include mime.types;
    types {
    application/javascript js mjs;
    }
    default_type application/octet-stream;

    @zhangweibo

    Thank you for the recommendation on clearing cache. That did the trick.

    2.2 Not working, no PDF file is displayed.

    Plugin Author Thomas McMahon

    (@twistermc)

    @autobots2009 Did you complete the items in the first post?

    Still having an issue. Made the htaccess change, cleared cache, tried incognito mode. Still no pdf displayed (the frame is there, just no content). Rollback to previous version works fine.

    I fixed this issue by rollback to version 2.1 (use rollback plugin)

    Plugin Author Thomas McMahon

    (@twistermc)

    Depends on your server type. Did you have a htaccess previously? Can I get the URL of your site?

Viewing 15 replies - 1 through 15 (of 97 total)
  • You must be logged in to reply to this topic.