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

Can't resolve '@swagger-api/apidom-json-pointer' in latest release #4539

Closed
benjdlambert opened this issue Nov 21, 2024 · 26 comments
Closed
Assignees
Labels
ApiDOM bug Something isn't working

Comments

@benjdlambert
Copy link

Looks like the latest release that went out appears to have broken our tests.

Error: Failed to compile '../../node_modules/@swagger-api/apidom-ns-openapi-3-1/src/refractor/toolbox.mjs':
  Module not found: Error: Can't resolve '@swagger-api/apidom-json-pointer' in '/tmp/backstage-e2e-wwR5QI/test-app/node_modules/@swagger-api/apidom-ns-openapi-3-1/src/refractor'

Wondering if this is a bad publish?

Additional build logs here: https://github.com/backstage/backstage/actions/runs/11952606327/job/33318690026

@benjdlambert benjdlambert changed the title broken latest release Can't resolve '@swagger-api/apidom-json-pointer' in latest release Nov 21, 2024
@IagorSs
Copy link

IagorSs commented Nov 21, 2024

Same error here, justly using @backstage/plugin-api-docs

@paztis
Copy link

paztis commented Nov 21, 2024

swagger-client webpack bundling totally fails also for us

@benjdlambert
Copy link
Author

benjdlambert commented Nov 21, 2024

Looks like adding a resolution for @swagger-api/apidom-json-pointer works for us, but not ideal.

   "resolutions": {
     "@types/react": "^18",
     "@types/react-dom": "^18",
+    "@swagger-api/apidom-json-pointer": "1.0.0-alpha.10"

@paztis
Copy link

paztis commented Nov 21, 2024

I found the problem

in @swagger-api/apidom-reference in version 1.0.0-alpha.10 you define in optionalDependencies

"@swagger-api/apidom-json-pointer": "^1.0.0-alpha.1",

it means it install the version 1.0.0-beta.0, while it is supposed to limit like in swagger-client to

"@swagger-api/apidom-json-pointer": ">=1.0.0-alpha.9 <1.0.0-beta.0",

@paztis
Copy link

paztis commented Nov 21, 2024

in fact it may be the same for all you optional dependencies.

  "optionalDependencies": {
    "@swagger-api/apidom-error": "^1.0.0-alpha.1",
    "@swagger-api/apidom-json-pointer": "^1.0.0-alpha.1",
    "@swagger-api/apidom-ns-asyncapi-2": "^1.0.0-alpha.1",
    "@swagger-api/apidom-ns-openapi-2": "^1.0.0-alpha.1",
    "@swagger-api/apidom-ns-openapi-3-0": "^1.0.0-alpha.1",
    "@swagger-api/apidom-ns-openapi-3-1": "^1.0.0-alpha.1",
    "@swagger-api/apidom-ns-workflows-1": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-api-design-systems-json": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-api-design-systems-yaml": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-asyncapi-json-2": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-asyncapi-yaml-2": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-json": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-openapi-json-2": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-openapi-json-3-0": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-openapi-json-3-1": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-openapi-yaml-2": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-openapi-yaml-3-0": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-openapi-yaml-3-1": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-workflows-json-1": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-workflows-yaml-1": "^1.0.0-alpha.1",
    "@swagger-api/apidom-parser-adapter-yaml-1-2": "^1.0.0-alpha.1"
  },

otherwise you must upgrade swagger-client to the beta version

@debabin
Copy link

debabin commented Nov 22, 2024

image

same, using "swagger-ui-react": "^5.18.2". the application breaks with version 5 of swagger-ui-react. resolutions did not help

@char0n
Copy link
Member

char0n commented Nov 22, 2024

Hi everybody.

Working on it.

@char0n
Copy link
Member

char0n commented Nov 22, 2024

First fix provided in https://github.com/swagger-api/apidom/releases/tag/v1.0.0-beta.1

Next fix comming in couple of minutes.

@char0n
Copy link
Member

char0n commented Nov 22, 2024

Second fix provided in #4549

@char0n
Copy link
Member

char0n commented Nov 22, 2024

Hi @paztis

swagger-client webpack bundling totally fails also for us.

swagger-client shouldn't pull betas automatically. It's has been prevented by following version constraints:

https://github.com/swagger-api/swagger-js/blob/e053486643541546077b8469df8a900b5ed48924/package.json#L77-L81

    "@swagger-api/apidom-core": ">=1.0.0-alpha.9 <1.0.0-beta.0",
    "@swagger-api/apidom-error": ">=1.0.0-alpha.9 <1.0.0-beta.0",
    "@swagger-api/apidom-json-pointer": ">=1.0.0-alpha.9 <1.0.0-beta.0",
    "@swagger-api/apidom-ns-openapi-3-1": ">=1.0.0-alpha.9 <1.0.0-beta.0",
    "@swagger-api/apidom-reference": ">=1.0.0-alpha.9 <1.0.0-beta.0",

@char0n
Copy link
Member

char0n commented Nov 22, 2024

@char0n
Copy link
Member

char0n commented Nov 22, 2024

Fix released in https://github.com/swagger-api/apidom/releases/tag/v1.0.0-beta.2.

Thanks for you patience.

@char0n char0n closed this as completed Nov 22, 2024
@char0n char0n self-assigned this Nov 22, 2024
@char0n char0n added bug Something isn't working ApiDOM labels Nov 22, 2024
@paztis
Copy link

paztis commented Nov 22, 2024

Wait. The problem is on 1.0.0-alpha.10 version, not on beta.0

If you didn't upgrade swagger-client, you must deliver a 1.0.0-alpha.11 with fixes

@char0n
Copy link
Member

char0n commented Nov 22, 2024

@paztis there is no issue with alpha.10. Alpha.10 has been released a month ago. Can you elaborate?

@paztis
Copy link

paztis commented Nov 22, 2024

All the issue I explain you is due to alpha.10

I. Alpha 10 delivery, you declare optionalDep of ^1.0.0-alpha.1

So if anyone install an alpha.10 it get beta.0 of the deps installed and this is what is crashing

As swagger-client continue to point to last alpha, your fix will not resolve anything

The only solution is to release an alpha.11 with the fix or re-release alpha 10

@paztis
Copy link

paztis commented Nov 22, 2024

With your current management, each time you release a beta with breaking changes, all the alpha are broken.
In the alpha are supposed to use only the alpha deps you must fix it

@paztis
Copy link

paztis commented Nov 22, 2024

The problem is mostly visible in the monorepos

@char0n
Copy link
Member

char0n commented Nov 22, 2024

Ok thank you I understand now, it's here: https://github.com/swagger-api/apidom/blob/main/packages/apidom-reference/package.json#L270. There is no upper boundary. So the apidom-reference@alpha might pull in the beta.

@paztis
Copy link

paztis commented Nov 22, 2024

Yes that's it

@char0n
Copy link
Member

char0n commented Nov 22, 2024

What I can do is fix that in next beta release and release a new swagger-client with that fix beta as lowest boundary. You can then pin your swagger-client to safeguard for future. alpha and beta are fully compatible and there is no plan to break the compatibility in beta. We'll not be releasing fixed alpha release. Would that work for you?

@paztis
Copy link

paztis commented Nov 22, 2024

If it is BWC it's ok for me

@char0n
Copy link
Member

char0n commented Nov 22, 2024

Reopening as we have to provider upper boundary for the optional dependencies.

@char0n char0n reopened this Nov 22, 2024
@jefag
Copy link

jefag commented Nov 22, 2024

Hey folks, we're seeing the below in our build, seems related to this thread? Is there a workaround?

I've tried the suggestions in the thread, no luck.

Error: Cannot find module '/workspace/node_modules/@swagger-api/apidom-parser-adapter-api-design-systems-json/src/adapter.cjs'
    at createEsmNotFoundErr (node:internal/modules/cjs/loader:[11](https://github.com/voteagora/agora-next/actions/runs/11977257933/job/33394736599#step:4:12)81:15)
    at finalizeEsmResolution (node:internal/modules/cjs/loader:1169:15)
    at resolveExports (node:internal/modules/cjs/loader:591:14)
    at Module._findPath (node:internal/modules/cjs/loader:668:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:[12](https://github.com/voteagora/agora-next/actions/runs/11977257933/job/33394736599#step:4:13)35:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/workspace/node_modules/@swagger-api/apidom-reference/src/parse/parsers/api-design-systems-json/index.cjs:7:48)
    at Module._compile (node:internal/modules/cjs/loader:[13](https://github.com/voteagora/agora-next/actions/runs/11977257933/job/33394736599#step:4:14)76:14) {
  code: 'MODULE_NOT_FOUND',
  path: '/workspace/node_modules/@swagger-api/apidom-parser-adapter-api-design-systems-json/package.json'
}

@char0n
Copy link
Member

char0n commented Nov 25, 2024

@jefag your issue is being addressed in #4555. Thanks for letting us know.

@char0n
Copy link
Member

char0n commented Nov 25, 2024

If it is BWC it's ok for me

Explicit upper bound defined inhttps://github.com//pull/4556

@char0n
Copy link
Member

char0n commented Nov 25, 2024

All known issues addressed in https://github.com/swagger-api/apidom/releases/tag/v1.0.0-beta.3. Please reopen if anything new popsup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ApiDOM bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants