Skip to content
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

Bug: Upgrading swagger-ui-react to 5.11 breaks compatibility with React 17 #9495

Closed
tudi2d opened this issue Jan 16, 2024 · 4 comments
Closed

Comments

@tudi2d
Copy link

tudi2d commented Jan 16, 2024

In the Backstage project are running into an issue with swagger-ui-react after the 5.11 release.

Expected: The expecation is that swagger-ui-react v5.11 still supports ">= 16.8 <18" as mentioned in the release. We use specific version resolution to use React ^17 in our workspace.

Actual behaviour: After updating to 5.11 creating an app fails with the following issue [1]:

[0] ERROR in ../../node_modules/swagger-ui-react/node_modules/react-redux/dist/react-redux.mjs 1097:18-45
[0] export 'useSyncExternalStore' (imported as 'React2') was not found in 'react' (possible exports: Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, cloneElement, createContext, createElement, createFactory, createRef, forwardRef, isValidElement, lazy, memo, useCallback, useContext, useDebugValue, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, version)
[0]
[0] webpack compiled with 1 error

[1] For more context checkout the various comments in the issue: backstage/backstage#22142

Q&A (please complete the following information)

  • OS: macOS
  • Version: swagger-ui-react 5.11
  • Method of installation: yarn
@jamieklassen
Copy link

Does this become redundant with the upgrade to React 18 in #22297?

@tudi2d
Copy link
Author

tudi2d commented Jan 18, 2024

Hej @jamieklassen. With the PR we do avoid the issue for newly created Backstage instances. At the same time we did expect React 17 to work here & there might be instances still on React 17 running into this issue in the future. And of course other projects might run into similar issues as well :)

@tudi2d
Copy link
Author

tudi2d commented Jan 18, 2024

alright - there is the documentation on this: https://github.com/swagger-api/swagger-ui/wiki/Using-older-version-of-React, which I missed. closing this for now.

@char0n
Copy link
Member

char0n commented Jan 18, 2024

Hi @tudi2d,

Glad you found the wiki. The link to wiki is directly in the release notes. Glad it eventually all worked for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants