Replies: 1 comment 5 replies
-
I feel you! I've double-checked the documentation, and you're right - the getting-started page wasn't up-to-date. I've updated every reference to the .js files. Also, I've deleted the references to the pdf.mjs file. It doesn't exist anymore, I've merged it with the viewer-*.mjs file. Just for the records, here are some useful links to the documentation:
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, this is just a heads-up for other devs who may face the same situation. I didn't read anything about this in the documentation. Although it is mentioned that the component relies on
viewer.min.js
andpdf.worker.min.js
to be in the assets folder, what is not mentioned, probably because it should be obvious in modern server setups, is that these files are now JS modules, soviewer.mjs
andpdf.worker.mjs
and they have to be served with the correct mimetype, that istext/javascript
. In our case, we have an old Java/Spring back-end which doesn't seem to have the correct modern settings for serving lots of different files including.mjs
and so we were getting this error:The problem is, I didn't get this error locally because of course
ng serve
uses the correct mimetype. and 2nd, Chrome was not throwing any error in the console, I only saw this on Edge. The viewer would just fail silently, not load anything else after the initial call to getviewer.min.js
.And this happened after we upgraded from v18.1.14 to v20.5.2.
Beta Was this translation helpful? Give feedback.
All reactions