PDF viewer load problem

Dear sirs,

we have the following problem. We use the following import without the ".js" extension:

import { PdfViewerComponent as EjsPdfviewer, Magnification, Navigation, Toolbar } from "@syncfusion/ej2-vue-pdfviewer";

When we try to use the PDF preview functionality in Firefox, we get the following error:

Loading script from “<our_domain>/public/js/ej2-pdfviewer-lib/pdfium.js” with importScripts() was blocked because of a disallowed MIME type (“text/html”).


When we try the same in Chrome, we get this:

Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://odpp-t.carina.local/public/js/ej2-pdfviewer-lib/pdfium.js' failed to load.


If we add the extension ".js" to the import, we cannot build the project because of the following error:

Rollup failed to resolve import "@syncfusion/ej2-vue-pdfviewer.js" from "<our_vue_file>". This is most likely unintended because it can break your application at runtime. If you want to externalize this module explicitly add it to `build.rollupOptions.external`...

We use VUE 3


Kind regards



1 Reply

PA Priyadharshini Annamalai Syncfusion Team January 24, 2025 01:16 PM UTC

Hi 


We are unable to replicate the issue on our end. Additionally, we have provided a sample for your reference, demonstrating our attempts to reproduce the issue. Could you please modify the sample and share it with us to help us replicate the issue? Additionally, describing the exact scenario where the issue occurs will help us analyze the request flow and provide more accurate support.

Could you also confirm whether you are using standalone mode or server mode? If you are using standalone mode, please ensure that the resource URL is referenced correctly in your application. For your convenience, we are sharing the documentation link to help you configure the resource URL at the application level.

Documentation: Getting started with EJ2 JavaScript PDF Viewer control | Syncfusion


Regards,

Priyadharshini



Loader.
Up arrow icon