question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't build with dfa 1.2.0

See original GitHub issue

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

  1. yarn install @react-pdf/renderer
  2. import { Page, Text, View, Document, StyleSheet } from ‘@react-pdf/renderer’ in React-Component
  3. Compile the project with webpacker or ./bin/webpack-dev-server

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):

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

24reactions
cristofercommented, Jul 23, 2019

I solved it adding the resolutions section in package.json

"dfa": "1.1.0"

And of course the package with that version as well

2reactions
nodepondcommented, Jun 18, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't build with dfa 1.2.0 · Issue #1061 · diegomura/react-pdf · GitHub
Currently the libraries current version is 1.2.0 and it causes the build procedure to exit out. One can still build by rolling back...
Read more >
pnglibconf.dfa - Apple Open Source
The file lists the various options # that can *only* be specified during the libpng build; # pnglibconf.h freezes the definitions selected for...
Read more >
scripts/pnglibconf.dfa - platform/external/libpng - Git at Google
scripts/pnglibconf.dfa - library build configuration control ... Added at libpng-1.2.0 ... fact it can't be disabled from the command line!)
Read more >
regex_automata::dense::Builder - Rust - Docs.rs
A single DFA cannot produce both the start and end of a match. For that information, use a ... Create a new DenseDFA...
Read more >
fas-js - npm Package Health Analysis - Snyk
1.2.0 ... Easily create and simulate state machines using this JS library. ... A Deterministic Finite Automaton (DFA) has exactly one transition for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found