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

'hive-pdf-viewer' is not a known element: #12

Closed
qwerqwermhc opened this issue Aug 24, 2018 · 7 comments
Closed

'hive-pdf-viewer' is not a known element: #12

qwerqwermhc opened this issue Aug 24, 2018 · 7 comments
Labels
Not an Issue Not an issue with the plugin. Issue with the end-users implementation.

Comments

@qwerqwermhc
Copy link

[Angular]
'hive-pdf-viewer' is not a known element:

  1. If 'hive-pdf-viewer' is an Angular component, then verify that it is part of this module.
  2. If 'hive-pdf-viewer' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
@qwerqwermhc
Copy link
Author

Can you do an ionic3 example? I read the documentation according to the above operation or not. Can you come to a small code for us to visit?

@qwerqwermhc
Copy link
Author

  1. npm i @teamhive/stencil-pdf-viewer
    2.import '@teamhive/stencil-pdf-viewer/dist/pdfviewer';
    I didn't understand the third part. I can build a small project. I can achieve it in ionic3 or 4. Let me see the effect? I read the documentation for this plugin is not very comprehensive or you can send me a mailbox to do a small ionic3 or 4 sample can you? Thank you very much.

@qwerqwermhc
Copy link
Author

https://github.com/VadimDez/ng2-pdf-viewer
This conditioning is very clear but he does not support the file now. I can't access it with this plugin.

@sean-perkins
Copy link
Contributor

sean-perkins commented Aug 24, 2018

These are non-issues to the plugin. Please use stack overflow or another medium for receiving help on web component implementations.

When using any stencil web component you need to add the CUSTOM_ELEMENTS_SCHEMA to the schemas declaration of your modules (for Angular).

There's no need to do framework specific examples, StencilJS documents integration paths: https://stenciljs.com/docs/framework-integration

@qwerqwermhc
Copy link
Author

Thank you very much for doing what you said but it does not support local files.

Fetch API cannot load file:///D:/pdftest/HGH-18123.pdf. URL scheme must be "http" or "https" for CORS request.
hive-pdf-viewer.js:80831 Unhandled promise rejection DOMException: Failed to execute 'postMessage' on 'Worker': TypeError: Failed to fetch could not be cloned.
at MessageHandler.postMessage (http://localhost:8100/build/pdfviewer/hive-pdf-viewer.js:58560:19)
at sendStreamRequest (http://localhost:8100/build/pdfviewer/hive-pdf-viewer.js:58377:14)
at Object.error (http://localhost:8100/build/pdfviewer/hive-pdf-viewer.js:58420:9)
at http://localhost:8100/build/pdfviewer/hive-pdf-viewer.js:66191:18
at run (http://localhost:8100/build/pdfviewer/hive-pdf-viewer.js:80796:22)
at http://localhost:8100/build/pdfviewer/hive-pdf-viewer.js:80813:30
at MutationObserver.flush (http://localhost:8100/build/pdfviewer/hive-pdf-viewer.js:80601:9)
at t.invoke (http://localhost:8100/build/polyfills.js:3:9283)
at r.runGuarded (http://localhost:8100/build/polyfills.js:3:4655)
at MutationObserver. (http://localhost:8100/build/polyfills.js:3:4267)

@sean-perkins
Copy link
Contributor

  1. The example is using local files.
  2. We use the plugin with our Ionic 4 Capacitor app that has offline files and it works.

Your issues is CORS, not the plugin. Security rules are preventing you from accessing the file. Either serve the file from a local server and access through a valid http/https schema or disable security rules for your device/browser (not recommended).

@sean-perkins sean-perkins added the Not an Issue Not an issue with the plugin. Issue with the end-users implementation. label Aug 27, 2018
@qwerqwermhc
Copy link
Author

I know that when I use the form ../../assets/conf/_archive/HGH-18123.pdf, he can do it but when I use the file: /// D:/pdftest/HGH-18123.pdf It can't be done. You can access the files in a folder under a certain drive letter on your computer. The file starts with the file:///.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not an Issue Not an issue with the plugin. Issue with the end-users implementation.
Projects
None yet
Development

No branches or pull requests

2 participants