-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Can't build with dfa 1.2.0 #643
Comments
After some deeper research I currently have the feeling, that this comes back to an issue with dfa 1.2.0 (that was published yesterday!). https://www.npmjs.com/package/dfa When I install the version 1.1.0 I get a precompliled version, that is understood by fontkit. The index.js at the 1.2.0 seems to be not precompiled, causing issues at importing it property at fontkit. |
Thanks! We can clse it then since it’s not a react-pdf bug? |
Hm, it actually has an impact on installing react-pdf currently (fails to install), if my suspicion is correct. But yeah, I should try to adress this at dfa. |
I solved it adding the
And of course the package with that version as well |
I get the error like this: solved use dfa verison 1.1.0 in @react-pdf/fontkit |
I just had this same problem and the fix from @cristofer worked pretty well. |
It looks like there is a potential fix for the downstream issue here foliojs/dfa#4 |
Describe the bug
I have a rails project with react, using webpacker and mostly babel for transforming javascript. When I try to use the @react-pdf/renderer in the project, the compiling of webpacker fails. I get the following error:
ERROR in ./node_modules/@react-pdf/fontkit/dist/fontkit.browser.es.js 8713:23-35 "export 'default' (imported as 'StateMachine') was not found in 'dfa'
To Reproduce
0. Setup a Ruby on Rails project with react, i.e. with react-rails
Indeed, if I look in the file /node_modules/@react-pdf/fontkit/dist/fontkit.browser.es.js line 6, where it tries to load the StateMachine it really looks like a bug to me.
import StateMachine from 'dfa'
And then in ./node_modules/dfa/index.js
The last line: module.exports = StateMachine is trying to export as commonJS and not as es-format.
Am I overseeing something here? Or is this actually a bug? I currently try to do some babel or webpack-config to solve this problem, but it seems like an issue to me.
Expected behavior
Make this instantly work, without the need to do additional webpack or babel config.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: