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

Getting strange error on generation: The "openapi-end" performance mark has not been set #1761

Open
etienne-monier opened this issue Feb 28, 2025 · 1 comment
Labels
bug 🔥 Something isn't working prioritized 🚚 This issue has been prioritized and will be worked on soon

Comments

@etienne-monier
Copy link

etienne-monier commented Feb 28, 2025

Description

Hi,

First, here are the versions I use:

❯ npm list | grep "@hey-api"
├── @hey-api/[email protected]
├── @hey-api/[email protected]

The configuration is below.

The command execution gives me

> [email protected] generate-client
> openapi-ts --file openapi-ts.config.ts --debug

userConfig: <configuration below>

⏳ Generating from .openapi.json
✨ Running Prettier
🚀 Done! Your output is in ./frontend/src/client
createClient: 552.53ms
config: 336.30ms (60.87%)
🔥 Unexpected error occurred. Log saved to xxx/openapi-ts-error-1740747464727.log
🔥 Unexpected error occurred. The "openapi-end" performance mark has not been set

and the log file gives:

The "openapi-end" performance mark has not been set
SyntaxError: The "openapi-end" performance mark has not been set
    at getMark (node:internal/perf/usertiming:65:11)
    at calculateStartDuration (node:internal/perf/usertiming:192:11)
    at measure (node:internal/perf/usertiming:220:7)
    at Performance.measure (node:internal/perf/performance:131:12)
    at Object.measure (xxx/node_modules/@hey-api/openapi-ts/dist/index.cjs:14:86417)
    at xxx/node_modules/@hey-api/openapi-ts/dist/index.cjs:14:86752
    at Array.forEach (<anonymous>)
    at mn.report (xxx/node_modules/@hey-api/openapi-ts/dist/index.cjs:14:86732)
    at oj (xxx/node_modules/@hey-api/openapi-ts/dist/index.cjs:1311:4642)
    at async start (xxx/node_modules/@hey-api/openapi-ts/bin/index.cjs:120:21)

This issue seems to produce a right client, but it raises an error indeed. Do you have an idea why this is thrown?

Thanks.

Reproducible example or configuration

Here is the configuration I get on command execution:

userConfig: {
  input: '.openapi.json',
  output: { format: 'prettier', path: 'src/client' },
  plugins: [
    '@hey-api/typescript',
    '@hey-api/sdk',
    { asClass: true, name: '@hey-api/sdk' },
    '@hey-api/client-axios'
  ],
  file: 'openapi-ts.config.ts',
  debug: true,
  configFile: 'openapi-ts.config.ts',
  logs: { level: 'debug' }
}
config: {
  pluginOrder: [ '@hey-api/typescript', '@hey-api/client-axios', '@hey-api/sdk' ],
  plugins: {
    '@hey-api/typescript': {
      _dependencies: [],
      _handler: [Function: wp],
      _handlerLegacy: [Function: Sp],
      enums: false,
      enumsCase: 'SCREAMING_SNAKE_CASE',
      exportFromIndex: true,
      exportInlineEnums: false,
      identifierCase: 'PascalCase',
      name: '@hey-api/typescript',
      output: 'types',
      style: 'preserve',
      tree: false
    },
    '@hey-api/client-axios': {
      _dependencies: [Array],
      _tags: [Array],
      baseUrl: true,
      bundle: false,
      exportFromIndex: false,
      output: 'client',
      _handler: [Function: at],
      _handlerLegacy: [Function: _handlerLegacy],
      name: '@hey-api/client-axios',
      throwOnError: false
    },
    '@hey-api/sdk': {
      _dependencies: [Array],
      _handler: [Function: Rp],
      _handlerLegacy: [Function: xp],
      _infer: [Function: _infer],
      asClass: true,
      auth: true,
      client: '@hey-api/client-axios',
      exportFromIndex: true,
      name: '@hey-api/sdk',
      operationId: true,
      output: 'sdk',
      response: 'body',
      serviceNameBuilder: '{{name}}Service'
    }
  },
  base: undefined,
  configFile: 'openapi-ts.config.ts',
  dryRun: false,
  experimentalParser: true,
  exportCore: false,
  input: { path: '.openapi.json' },
  logs: {
    level: 'debug',
    path: 'xxx'
  },
  name: undefined,
  output: {
    clean: true,
    format: 'prettier',
    indexFile: true,
    lint: false,
    path: 'xxx/src/client'
  },
  request: undefined,
  useOptions: true,
  watch: { enabled: false, interval: 1000, timeout: 60000 },
  client: {
    _dependencies: [ '@hey-api/typescript' ],
    _tags: [ 'client' ],
    baseUrl: true,
    bundle: false,
    exportFromIndex: false,
    output: 'client',
    _handler: [Function: at],
    _handlerLegacy: [Function: _handlerLegacy],
    name: '@hey-api/client-axios',
    throwOnError: false
  }
}

OpenAPI specification (optional)

No response

System information (optional)

Linux 64
npm 10.5.2
node v20.13.1

@etienne-monier etienne-monier added the bug 🔥 Something isn't working label Feb 28, 2025
@mrlubos
Copy link
Member

mrlubos commented Feb 28, 2025

Thanks, I'll have a look @etienne-monier. In the meantime, disable debug logs and it will pass

@mrlubos mrlubos added the prioritized 🚚 This issue has been prioritized and will be worked on soon label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🔥 Something isn't working prioritized 🚚 This issue has been prioritized and will be worked on soon
Projects
None yet
Development

No branches or pull requests

2 participants