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

Couldn't find package "@swagger-api/apidom-core@=0.68.1" required by "swagger-client@=3.19.0-beta.7" on the "npm" registry. #8418

Closed
ReviewSolicitors opened this issue Feb 24, 2023 · 3 comments

Comments

@ReviewSolicitors
Copy link

ReviewSolicitors commented Feb 24, 2023

  • OS: macOS
  • Browser: n/a
  • Version: n/a
  • Method of installation: yarn
  • Swagger-UI version: 4.16.0
  • Swagger/OpenAPI version: n/a

Content & configuration

package.json

dependencies: {
    ...
    "swagger-ui-react": "^4.12.0",
    ...
}

Since the 4.16.0, when installing swagger-ui-react via yarn it fails with the following output. Installing with 4.15.5 specified works fine.

error Couldn't find package "@swagger-api/apidom-core@=0.68.1" required by "swagger-client@=3.19.0-beta.7" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Couldn't find package "@swagger-api/apidom-ns-openapi-3-1@=0.68.1" required by "swagger-client@=3.19.0-beta.7" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:721:66)
    at new MessageError (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:310:30)
    at /usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:323:13
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "@swagger-api/apidom-reference@=0.68.1" required by "swagger-client@=3.19.0-beta.7" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:721:66)
    at new MessageError (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:310:30)
    at /usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:323:13
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Couldn't find package "@swagger-api/apidom-json-pointer@=0.68.1" required by "swagger-client@=3.19.0-beta.7" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:721:66)
    at new MessageError (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:36590:17)
    at Generator.throw (<anonymous>)
    at step (/usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:310:30)
    at /usr/local/Cellar/yarn/1.22.19/libexec/lib/cli.js:323:13
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

To reproduce...

Run yarn install with "swagger-ui-react": "^4.16.0" as a dependency.

Additional context or thoughts

Possibly the dependencies are incorrectly pointing to beta releases?

@sennyeya
Copy link

Looks like the bundleDependencies used to include the Github package registry packages, @swagger-api/apidom-core, @swagger-api/apidom-reference, ..., isn't supported by Yarn 2.x. https://yarnpkg.com/getting-started/migration#dont-use-bundledependencies and yarnpkg/yarn#5998 (comment).

@char0n
Copy link
Member

char0n commented Feb 25, 2023

Hi everybody,

Thanks for detailed report. I can confirm the regression. I'll create a reverting commit and subsequent release.


Background

We're in the process of implementing OpenAPI 3.1.0 support in SwaggerUI. The processing of OpenAPI 2.0/3.0.x/3.1.0 comes from swagger-client library. swagger-client is current in latest beta phase - swagger-api/swagger-js#2836. We wanted to make sure that we can use latest swagger-client beta (with OpenAPI 3.1.0 support) in completely backward compatible way with SwaggerUI. We decided to use bundleDependencies field of package.json to avoid publishing ApiDOM to npm and expedite the support for OpenAPI 3.1.0 as fast as possible.

Given this issue, we now know that AFAICT yarn@2 is the only npm package manager that doesn't support bundleDependencies. Also given that yarn@2 is still highly used package manager we must support it fully. This means that ApiDOM must be published to npmjs.com so that yarn@2 can process swagger-client package (with ApiDOM as transitive deps) in fully backward compatible way.

char0n added a commit that referenced this issue Feb 25, 2023
swagger-client has been reverted back to ^3.18.5,
becase it intrduces backward incompatible behavior
for yarn@2 package manager.

Refs 6164292
Refs d293555
Refs #8418
char0n added a commit that referenced this issue Feb 25, 2023
swagger-client has been reverted back to ^3.18.5,
because it introduces backward incompatible behavior
for yarn@2 package manager.

Refs 6164292
Refs d293555
Refs #8418
@char0n
Copy link
Member

char0n commented Feb 25, 2023

@char0n char0n closed this as completed Feb 25, 2023
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