-
Notifications
You must be signed in to change notification settings - Fork 809
bug: Rollup: Plugin Error: ./node_modules/pdfjs-dist/build/pdf.js:2614:2 #3808
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
Comments
Hello @rahulgupta-dev, thanks for filing this issue! I've just checked out your reproduction case (thank for providing that!) and confirmed that there is an issue at present. I believe it has to do with the use of private class fields in the class Foobar {
#privateFoobar = "asdfasdfasdf";
} I haven't confirmed this, but I believe that the current version of one of our Rollup plugins does not support this, so at present it won't be possible to use However! The Mozilla team which distributes
I was able to get your reproduction to build by using that instead, by changing the import: diff --git a/src/components/pdf-viewer/pdf-viewer.tsx b/src/components/pdf-viewer/pdf-viewer.tsx
index cdf407d..73aaefd 100644
--- a/src/components/pdf-viewer/pdf-viewer.tsx
+++ b/src/components/pdf-viewer/pdf-viewer.tsx
@@ -1,5 +1,5 @@
import { Component, Element, h, Listen, Prop, State } from '@stencil/core'
-import pdfjsLib from 'pdfjs-dist'
+import pdfjsLib from 'pdfjs-dist/legacy/build/pdf'
import pdfjsWorker from 'pdfjs-dist/build/pdf.worker.entry' It does look like there's another issue with CORS, but having used Anyway! I believe this will be fixed when we upgrade Rollup. I will label it for prioritization in our internal backlog now. Thanks again for filing and for providing a reproduction! |
Hello! I just ran into this same issue with another module that is compiled with private class fields. Is this still not supported even in the current Stencil Core v4.7.0? |
Hey! |
A fixed was published in https://github.com/stenciljs/core/releases/tag/v4.28.0 🎉 |
Uh oh!
There was an error while loading. Please reload this page.
Prerequisites
Stencil Version
"@stencil/core": "^2.6.0"
Current Behavior
having issue when using "pdfjs-dist": "^3.0.279" in stencil component, getting below errors
Unexpected token (2614:2) in .\node_modules\pdfjs-dist\build\pdf.js (plugin: commonjs, transform)
below is my stencil component
Expected Behavior
should not get the below error,
Unexpected token (2614:2) in .\node_modules\pdfjs-dist\build\pdf.js (plugin: commonjs, transform)
Steps to Reproduce
run npm install
run npm start
Code Reproduction URL
https://github.com/rahulgupta-dev/pdf-viewer
Additional Information
help if there is any issue in compiler/stencil/pdfjs versions
Node version: v18.12.0
Windows x86
The text was updated successfully, but these errors were encountered: