stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
474 stars 181 forks source link

GET viewer-4.6.688.min.mjs NS_ERROR_CORRUPTED_CONTENT #2577

Closed addielmoldes closed 1 week ago

addielmoldes commented 1 week ago

I have this error when trying to display a pdf file Screenshot from 2024-09-22 03-17-30

I'm running Angular v18.2.4, ngx-extended-pdf-viewer v21.4.1, my browser is Mozilla Firefox 130, also I'm using angular-architects' native federation for micro-frontends architecture, my OS Manjaro Linux and NodeJs v20.13.10

stephanrauh commented 1 week ago

You have to configure your server such that it supports *.mjs files. This file type has been around for years, but for some reason unknown, many servers still don't recognise these files as JavaScript. Have a look at https://pdfviewer.net/extended-pdf-viewer/troubleshooting - I've explained the problem and the solution for a few popular servers.

roopeshkurian commented 8 hours ago

I am also facing almost similar issue. I am using Angular 18.2.x. When I checked the node_modules folder I could not see viewer-4.6.688.min.mjs

image

But I can see viewer-4.6.688.mjs Can you please check ? I really appreciate your help

addielmoldes commented 7 hours ago

The way I solved this was by adding these lines in angular.json file

image

roopeshkurian commented 7 hours ago

I already have this in my angular.json file. ngx-extended-pdf-viewer version 21.4.1 is working great. But when I am trying to install new version(21.4.3) its giving me this error. When I checked node modules assets folder , I could not find viewer-4.6.688.min.mjs

KillerCodeMonkey commented 58 minutes ago

@stephanrauh yes, i can confirm the file is missing in latest release.

the viewer tries to load min.mjs, but only a .mjs file is there