Comments (6)
Hi @jopicornell,
Thank you for providing the Stackblitz project. Now I see the issue and I see that it is not in Vite, but in Vite+Ionic. Also the explanation in the Ionic repo looks relevant, will try to figure it out.
from vue-pdf-embed.
Hi @hrynko !
Have you found something relevant to fix this issue? I can help you if necessary, but I can't find the real problem. I'll give it another look in case I feel inspired and find it.
from vue-pdf-embed.
Honestly, I'm too busy with other projects right now and haven't had enough time to dive into this issue. But the discussion from the Ionic repo looks very much like this case. The main point there is having 2 instances of Vue because of require('vue')
in the bundle. I assume this can be solved by adjusting the Webpack config (see externals).
I would appreciate if you could try to fix this. For testing purposes you can fork the vue-pdf-emded
repo and install into your project via Git or clone it and install locally (npm i file:<PROJECT_LOCATION>
). Please let me know if you need any help. Thanks!
from vue-pdf-embed.
Hello,
Thank you for your reply. I've been doing some tests, and I've come to a dead end. In webpack.config.js there's a externals: { vue: 'vue' }
, which should be enough. The problem is that vue-loader v16 seems to ignore that and is using require('vue')
in the compilated file. I've tried to update vue-loader to v17 for Vue 3, but seems like they have a problem in their compilated code and it throws an error ( Cannot find module 'vue/compiler-sfc'), which no one seems to know how to solve it.
I'm sensing that Vue community/devs is focusing on vite and are abandoning their webpack build tools. I suggest compiling the project with Vite, but that will bring other issues for sure. Let me know if you have any idea on how to face this issue. I can investigate further, but my knowledge of compiling libraries is rather limited.
from vue-pdf-embed.
Hi @jopicornell,
I had another attempt to fix this (based on your suggestions), but no success yet. Migration to Vite might make sense, but support for Vue 2 would then be lost.
Also, I haven't been able to find any successful cases of solving this problem in other libraries, so unfortunately I will have to put this issue on hold for now.
from vue-pdf-embed.
Resolved in v2.0.0
after switching to Vite
from vue-pdf-embed.
Related Issues (20)
- An error occurs when IE11 is running vue2+cli-service5 HOT 1
- using vue-pdf-embed with vue+ts+vite when rendering multi-page pdf and specify that page cannot be rendered HOT 1
- vue-pdf-embed v1.2.1 - Performance issue with large PDF files
- how use Web Worker Loading in vite
- V2 Rendering quality issues compared to 1.2.1 HOT 3
- Rendering PDF with Annotation Layer
- Rotation Causes Blinking and Memory Spike
- When printing invoices, one page of PDF will become two pages HOT 1
- node_modules/vue-pdf-embed/dist/index.mjs (3293:33): Use of eval in "node_modules/vue-pdf-embed/dist/index.mjs" is strongly discouraged as it poses security risks and may cause issues with minification. HOT 2
- "Module parse failed: Unexpected token (1:54175) File was processed with these loaders: * ./node_modules/babel-loader/lib/index.js"
- vue3 中 pdf 内容错乱 HOT 1
- The requested module 'pdfjs-dist' does not provide an export named 'PasswordResponses' HOT 3
- redundant render base64 pdf cause same canvas render multiple time error HOT 1
- Import font package not found
- Vulnerabilities HOT 1
- xiaomi phone in have this a problem t.a is not a function
- [Bug Report] Memory leaks after changing the page width
- PDF.js Critical Vulnerability HOT 5
- InvalidAccessError: Failed to set the 'responseType' property on 'XMLHttpRequest': The response type cannot be changed for synchronous requests made from a document.
- pdf加载失败 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-pdf-embed.