api-platform / create-client

Generate React or Vue.js-based Progressive Web Apps from an Hydra-enabled API. Also support React Native.
https://api-platform.com/docs/client-generator/
MIT License
369 stars 132 forks source link

api-platform/client not working: Client network socket disconnected before secure TLS connection was established #341

Closed Florian-Rowehy closed 1 year ago

Florian-Rowehy commented 1 year ago

API Platform version(s) affected: 3.0.0

Description
2 weeks ago I started a new project using the API Platform distribution.

I tried to use the create-client library. While reading the 2.7 documentation I discovered that pnpm was not installed. So I upgraded the pwa dockerfile and the whole pwa folder to the latest version. I have not added any other file, the pwa is a strict copy of the current main api-platform/api-platform pwa folder

The image runs correctly, I can access the index, /admin and /docs normally.

When I try the command docker compose exec pwa pnpm create @api-platform/client -g next it does not do anything, as if the command is incomplete.

And when using docker compose exec pwa pnpm create @api-platform/client -g next https://caddy .
I get a cause: Error: Client network socket disconnected before secure TLS connection was established `

docker compose exec pwa pnpm create @api-platform/client -g next https://caddy/docs .    
../../.pnpm-store/v3/tmp/dlx-53          |  WARN  deprecated highlight.js@9.18.5
../../.pnpm-store/v3/tmp/dlx-53          |  WARN  deprecated source-map-resolve@0.5.3
../../.pnpm-store/v3/tmp/dlx-53          |  WARN  deprecated resolve-url@0.2.1
../../.pnpm-store/v3/tmp/dlx-53          |  WARN  deprecated source-map-url@0.4.1
../../.pnpm-store/v3/tmp/dlx-53          |  WARN  deprecated urix@0.1.0
../../.pnpm-store/v3/tmp/dlx-53          |  WARN  deprecated gulp-header@1.8.12
../../.pnpm-store/v3/tmp/dlx-53          | +216 ++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /.pnpm-store/v3
  Virtual store is at:             ../../.pnpm-store/v3/tmp/dlx-53/node_modules/.pnpm
../../.pnpm-store/v3/tmp/dlx-53          | Progress: resolved 216, reused 216, downloaded 0, added 216, done
(node:69) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
{
  api: Api { entrypoint: 'https://caddy', resources: [] },
  error: TypeError: fetch failed
      at Object.processResponse (node:internal/deps/undici/undici:6406:34)
      at node:internal/deps/undici/undici:6727:42
      at node:internal/process/task_queues:140:7
      at AsyncResource.runInAsyncScope (node:async_hooks:203:9)
      at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
    cause: Error: Client network socket disconnected before secure TLS connection was established
        at connResetException (node:internal/errors:711:14)
        at TLSSocket.onConnectEnd (node:_tls_wrap:1593:19)
        at TLSSocket.emit (node:events:525:35)
        at endReadableNT (node:internal/streams/readable:1359:12)
        at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
      code: 'ECONNRESET',
      path: undefined,
      host: 'caddy',
      port: 443,
      localAddress: undefined
    }
  },
  response: undefined,
  status: undefined
}

Any idea where it can come from? Caddy is kept untouched.