Skip to content

[@hey-api/openapi-ts] Code generation error with PnP #2237

Open
@FedeBev

Description

@FedeBev

Description

Hi there,

I'm getting the following error when using pnp

🛑 @hey-api/openapi-ts encountered an error.

❗️ Error: ENOENT: no such file or directory, lstat '<my_path>/apidashboard/dashboard/.yarn/__virtual__/@hey-api-openapi-ts-virtual-18cd877adc/7/.yarn/berry/cache/@hey-api-openapi-ts-npm-0.76.0-dacffafb6d-10c0.zip/node_modules/@hey-api/openapi-ts/dist/clients/core'

this is my openapi-ts.config.ts

import { defineConfig } from "@hey-api/openapi-ts";

export default defineConfig({
  input: "http://localhost:9090/v1/openapi",
  output: {
    format: "prettier",
    lint: "eslint",
    path: "./src/client",
  },
  plugins: [
    "@hey-api/client-fetch",
    "@hey-api/schemas",
    {
      dates: true,
      name: "@hey-api/transformers",
    },
    "@tanstack/react-query",
  ],
});

My environment

  • node version: v22.12.0
  • @hey-api/openapi-ts: 0.76.0
  • yarn version: 4.9.2

It works as expected setting nodeLinker: node-modules

Reproducible example or configuration

https://stackblitz.com/edit/hey-api-client-fetch-example

OpenAPI specification (optional)

No response

System information (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🔥Something isn't workingneeds info ⏳Further information is required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions