nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.22k stars 2.31k forks source link

New express workspace has failing e2e tests #27629

Open igo opened 2 weeks ago

igo commented 2 weeks ago

Current Behavior

 FAIL   xxx-e2e  apps/xxx-e2e/src/xxx/xxx.spec.ts
  GET /
    ✕ should return a message (35 ms)

  ● GET / › should return a message

    AggregateError

      at Function.Object.<anonymous>.AxiosError.from (../../node_modules/axios/lib/core/AxiosError.js:92:14)
      at RedirectableRequest.handleRequestError (../../node_modules/axios/lib/adapters/http.js:620:25)
      at ClientRequest.eventHandlers.<computed> (../../node_modules/follow-redirects/index.js:38:24)
      at Axios.request (../../node_modules/axios/lib/core/Axios.js:45:41)

    Cause:
    AggregateError

AggregateError is:

    AxiosError {
      code: 'ECONNREFUSED',
      errors: [
        Error: connect ECONNREFUSED ::1:3000
            at createConnectionError (node:net:1646:14)
            at afterConnectMultiple (node:net:1676:16) {
          errno: -61,
          code: 'ECONNREFUSED',
          syscall: 'connect',
          address: '::1',
          port: 3000
        },
        Error: connect ECONNREFUSED 127.0.0.1:3000
            at createConnectionError (node:net:1646:14)
            at afterConnectMultiple (node:net:1676:16) {
          errno: -61,
          code: 'ECONNREFUSED',
          syscall: 'connect',
          address: '127.0.0.1',
          port: 3000
        }
      ],
      message: '',
      name: 'AggregateError',
      config: {
        transitional: {
          silentJSONParsing: true,
          forcedJSONParsing: true,
          clarifyTimeoutError: false
        },
        adapter: [ 'xhr', 'http', 'fetch' ],
        transformRequest: [ [Function: transformRequest] ],
        transformResponse: [ [Function: transformResponse] ],
        timeout: 0,
        xsrfCookieName: 'XSRF-TOKEN',
        xsrfHeaderName: 'X-XSRF-TOKEN',
        maxContentLength: -1,
        maxBodyLength: -1,
        env: { FormData: [Function], Blob: [class Blob] },
        validateStatus: [Function: validateStatus],
        headers: Object [AxiosHeaders] {
          Accept: 'application/json, text/plain, */*',
          'Content-Type': undefined,
          'User-Agent': 'axios/1.7.5',
          'Accept-Encoding': 'gzip, compress, deflate, br'
        },
        baseURL: 'http://localhost:3000',
        method: 'get',
        url: '/',
        data: undefined
      },
      request: <ref *1> Writable {
        _events: {
          close: undefined,
          error: [Function: handleRequestError],
          prefinish: undefined,
          finish: undefined,
          drain: undefined,
          response: [Function: handleResponse],
          socket: [Function: handleRequestSocket]
        },
        _writableState: WritableState {
          highWaterMark: 16384,
          length: 0,
          corked: 0,
          onwrite: [Function: bound onwrite],
          writelen: 0,
          bufferedIndex: 0,
          pendingcb: 0,
          [Symbol(kState)]: 17580812,
          [Symbol(kBufferedValue)]: null
        },
        _maxListeners: undefined,
        _options: {
          maxRedirects: 21,
          maxBodyLength: Infinity,
          protocol: 'http:',
          path: '/',
          method: 'GET',
          headers: [Object: null prototype],
          agents: [Object],
          auth: undefined,
          family: undefined,
          beforeRedirect: [Function: dispatchBeforeRedirect],
          beforeRedirects: [Object],
          hostname: 'localhost',
          port: '3000',
          agent: undefined,
          nativeProtocols: [Object],
          pathname: '/'
        },
        _ended: true,
        _ending: true,
        _redirectCount: 0,
        _redirects: [],
        _requestBodyLength: 0,
        _requestBodyBuffers: [],
        _eventsCount: 3,
        _onNativeResponse: [Function (anonymous)],
        _currentRequest: ClientRequest {
          _events: [Object: null prototype],
          _eventsCount: 7,
          _maxListeners: undefined,
          outputData: [],
          outputSize: 0,
          writable: true,
          destroyed: false,
          _last: true,
          chunkedEncoding: false,
          shouldKeepAlive: true,
          maxRequestsOnConnectionReached: false,
          _defaultKeepAlive: true,
          useChunkedEncodingByDefault: false,
          sendDate: false,
          _removedConnection: false,
          _removedContLen: false,
          _removedTE: false,
          strictContentLength: false,
          _contentLength: 0,
          _hasBody: true,
          _trailer: '',
          finished: true,
          _headerSent: true,
          _closed: false,
          socket: [Socket],
          _header: 'GET / HTTP/1.1\r\n' +
            'Accept: application/json, text/plain, */*\r\n' +
            'User-Agent: axios/1.7.5\r\n' +
            'Accept-Encoding: gzip, compress, deflate, br\r\n' +
            'Host: localhost:3000\r\n' +
            'Connection: keep-alive\r\n' +
            '\r\n',
          _keepAliveTimeout: 0,
          _onPendingData: [Function: nop],
          agent: [Agent],
          socketPath: undefined,
          method: 'GET',
          maxHeaderSize: undefined,
          insecureHTTPParser: undefined,
          joinDuplicateHeaders: undefined,
          path: '/',
          _ended: false,
          res: null,
          aborted: false,
          timeoutCb: [Function: emitRequestTimeout],
          upgradeOrConnect: false,
          parser: null,
          maxHeadersCount: null,
          reusedSocket: false,
          host: 'localhost',
          protocol: 'http:',
          _redirectable: [Circular *1],
          [Symbol(shapeMode)]: false,
          [Symbol(kCapture)]: false,
          [Symbol(kBytesWritten)]: 0,
          [Symbol(kNeedDrain)]: false,
          [Symbol(corked)]: 0,
          [Symbol(kOutHeaders)]: [Object: null prototype],
          [Symbol(errored)]: null,
          [Symbol(kHighWaterMark)]: 16384,
          [Symbol(kRejectNonStandardBodyWrites)]: false,
          [Symbol(kUniqueHeaders)]: null
        },
        _currentUrl: 'http://localhost:3000/',
        [Symbol(shapeMode)]: true,
        [Symbol(kCapture)]: false
      },
      cause: AggregateError
          at internalConnectMultiple (node:net:1116:18)
          at afterConnectMultiple (node:net:1683:7) {
        code: 'ECONNREFUSED',
        [errors]: [ [Error], [Error] ]
      }
    }

Expected Behavior

e2e tests pass out of the box

GitHub Repo

No response

Steps to Reproduce

npx create-nx-workspace@latest --preset=express --name xxx --appName xxx --ci github
nx e2e xxx-e2e

Nx Report

Node           : 20.12.2
OS             : darwin-arm64
Native Target  : aarch64-macos
npm            : 10.5.0

nx                 : 19.6.2
@nx/js             : 19.6.2
@nx/jest           : 19.6.2
@nx/linter         : 19.6.2
@nx/eslint         : 19.6.2
@nx/workspace      : 19.6.2
@nx/devkit         : 19.6.2
@nx/eslint-plugin  : 19.6.2
@nx/express        : 19.6.2
@nx/node           : 19.6.2
@nrwl/tao          : 19.6.2
@nx/web            : 19.6.2
@nx/webpack        : 19.6.2
typescript         : 5.5.4
---------------------------------------
Registered Plugins:
@nx/webpack/plugin
@nx/eslint/plugin
@nx/jest/plugin

Failure Logs

FAIL   xxx-e2e  apps/xxx-e2e/src/xxx/xxx.spec.ts
  GET /
    ✕ should return a message (35 ms)

  ● GET / › should return a message

    AggregateError

      at Function.Object.<anonymous>.AxiosError.from (../../node_modules/axios/lib/core/AxiosError.js:92:14)
      at RedirectableRequest.handleRequestError (../../node_modules/axios/lib/adapters/http.js:620:25)
      at ClientRequest.eventHandlers.<computed> (../../node_modules/follow-redirects/index.js:38:24)
      at Axios.request (../../node_modules/axios/lib/core/Axios.js:45:41)

    Cause:
    AggregateError


### Package Manager Version

_No response_

### Operating System

- [X] macOS
- [ ] Linux
- [ ] Windows
- [ ] Other (Please specify)

### Additional Information

_No response_
robmanganelly commented 2 weeks ago

same here