PDF React Incompatibility Regression #425
Open
+889
−1,776
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR
This PR fixes a regression related to a recent build config change in
@recogito/react-pdf-annotator. The fix itself happened in the library build. This PR just updates ourpackage.jsonto the lastest, bugfixed lib version.The problem: After upgrading
@recogito/react-pdf-annotatorfrom version 1.2.0 to 1.3.0, PDF rendering would break fatally on load with the following message:The only change between the two version was an adjustment in the package build configuration, which attempted to make the package "dual-support", i.e. compatible with both React 18 and 19. (Recogito Studio currently uses React 18, but will likely get upgraded to React 19 at some point.)
The catch: The build config change made the declaration look compatible to host applications that used either React 18 or 19. But the bundle itself was now getting built with React 19. Which means that – despite the React 18/19 declaration – host apps using React 18 would run into the above error at runtime.
The fix to this problem is here, and was to:
peerDependenciesaccept both React 18 and 19, but at the same timedevDependency, so that the library itself gets built against React 18.