stephanrauh / ngx-extended-pdf-viewer

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

Getting `MIME` error with `bleeding-edge` and storybook #663

Closed vic1707 closed 3 years ago

vic1707 commented 3 years ago

Describe the bug Getting MIME error. in two cases :

In both cases the console is reporting the same thing...

Additionnal infos : Storybook as complete access to the assets folder given to it from the lib. (with direct link i can access any file from the assets folder of lib) : http://localhost:6006/assets/viewer-2.7.673.min.js is redirecting just fine.

Version info

Desktop (please complete the following information):

To Reproduce Use the bleeding-edge version ?

Demo PDF file https://pdfviewer.net/assets/pdfs/The Public Domain - Enclosing the Commons of the Mind.pdf

Screenshots BLEEDING-EDGE ng serve image storybook image

NORMAL ASSETS FOLDER : ng serve : no problem at all storybook : image with this time an error on the reader it-self (nothing when using bleeding-edge): image

stephanrauh commented 3 years ago

If you're using version 8.1.1., pdf.js 2.7.673 is not the "bleeding edge" version. It should load pdf-2.8.230.js instead. I suspect the library runs into an error message when it's trying to load pdf-2.7.673.js, so it's true, the error message consists of pure HTML code.

Maybe that's also the storybook bug. I'm not familiar with storybook, so I'd benefit from a reproducer. Can you send me a project showing the error, but without requiring me to install third-party libraries?

vic1707 commented 3 years ago

In fact one of the advantages of storybook is that it's independent from a ng serve, so the error of loading pdf.js 2.7.673 isn't storybook related (at least for this ng serve screen shot.

If you want i can add you to the private repo i'm talking about

stephanrauh commented 3 years ago

Yes, I think that'd be helpful. Plus, I'm curious what you're doing. :)

vic1707 commented 3 years ago

invitation sent ^^

Be aware that the change tobleeding-edge hasn't been commited and that the reader.component doesn't contain anything from the lib for the moment (due to it not functioning at the moment).

stephanrauh commented 3 years ago

Off topic: at the moment I don't updating to the bleeding edge branch. I'm always happy when somebody does, because it helps me to spot potential bugs early, but I'm not sure what the pdf.js team is currently doing. They seem to develop an all-new scripting engine, but I don't know how to include that engine, so it's possible updating to the bleeding edge branch introduces bugs. The quality standard of pdf.js is extraordinarily high, but it's possible I need to do something I'm not aware of to include the new features.

vic1707 commented 3 years ago

I'd love to be able to help you and will try to do my best. Unfortunately as I'm completely new to website development in general i don't even know where to start :cold_sweat:, but i'll look at it as much as possible and see it as a learning project !

If you have any question about my repo, do not hesitate, send me an email or if you prefer we can use a direct-chat app of your choice ^^

stephanrauh commented 3 years ago

Already did. :) But maybe my e-mail didn't arrive? BTW, website development isn't difficult.

vic1707 commented 3 years ago

For some reason you ended up in the spam folder... I replied to it just now.

vic1707 commented 3 years ago

Issue fixed for ng serve. Problem was caused by missing imports, and wrong output for angular.json.

I submitted changes for the docs according to this issue.

As for Storybook, I still have no clue. But the Storybook component if used in ng serve it works well.

stephanrauh commented 3 years ago

Is it still an issue you're trying to solve?