Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack: missing bundles #109

Open
zzacharo opened this issue Feb 27, 2020 · 3 comments
Open

webpack: missing bundles #109

zzacharo opened this issue Feb 27, 2020 · 3 comments

Comments

@zzacharo
Copy link
Member

In this file there is a dependency on /static/js/pdfjs/pdf.worker.min.js but the file is not bundled. We should either include it in the static file or create a specific bundle for that. Or align assets/js/pdfjs/viewer.js with static/js/pdfjs/viewer.js.

@egabancho
Copy link
Member

Is this somehow connected with this error message?

The resource from “https://127.0.0.1:5000/static/js/pdfjs/pdf.worker.min.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff). loremipsum.pdf

I'm using Invenio-Previewer 1.1.0 and Firefox 73.0.1

@zzacharo
Copy link
Member Author

zzacharo commented Mar 2, 2020

@egabancho what I noticed is that the file is required but not placed correctly under /static. Your issue seems more like a CSP one. In my case the pdf preview is working properly but still I think the fact that the file is not there needs to be addressed by removing it if is not necessary or fixing it :)

@lnielsen lnielsen reopened this Nov 29, 2020
@ppanero ppanero self-assigned this Dec 4, 2020
@ppanero
Copy link
Member

ppanero commented Dec 4, 2020

Tl;DR:

  • Files are duplicated in assets and statics.
  • When in assets, the import works because, afterwards is importing from static.
  • Any import in js, should be bundled in webpack and removed from static. This might require to put those files in it's own bundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants