Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

pdf not visible on flutter web when hosted without building with (--web-renderer html ) flag #140

Open
CoderJerry opened this issue Mar 14, 2024 · 5 comments

Comments

@CoderJerry
Copy link

No description provided.

@espresso3389
Copy link
Owner

I've tested with the following two configurations and both build and run correctly:

flutter build web --release --verbose --web-renderer=html
flutter build web --release --verbose --web-renderer=canvaskit

Could you please show your flutter doctor -v ?

@CoderJerry
Copy link
Author

it runs well on system but when i hosted it on firebase hosting it did not worked...but without changing any code when i build with flutter build web --release --web-renderer html it worked finee

@espresso3389
Copy link
Owner

It seems that it's out of Flutter/pdfrx scope.
My guess is that PDF is not hosted on the same origin. CORS or something prevents the app from loading the PDF correctly.

@espresso3389
Copy link
Owner

.but without changing any code when i build with flutter build web --release --web-renderer html it worked finee

Do you mean, you're building the app without --web-renderer option?

If so, according to flutter build web --help,

    --web-renderer                                           The renderer implementation to use when building for the web.

          [auto] (default)                                   Use the HTML renderer on mobile devices, and CanvasKit on desktop devices.
          [canvaskit]                                        Always use the CanvasKit renderer. This renderer uses WebGL and WebAssembly to render graphics.
          [html]                                             Always use the HTML renderer. This renderer uses a combination of HTML, CSS, SVG, 2D Canvas, and WebGL.
          [skwasm]                                           Always use the experimental skwasm renderer.

The default renderer changes depending on the device. On what device do you testing?

Anyway, I want to repeat the phrase; please show me your flutter doctor -v. I don't know anything about your environment. Everything is just my guess :(

@irajeshh
Copy link

Works on debug and release mode on localhost only.
After hosting it to firebase hosting the below error is showing
MissingPluginException(No implementation found for method data on channel pdf_render)

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

No branches or pull requests

3 participants