Skip to content

ts error: generated import missing .js extension #358

@clicktodev

Description

@clicktodev

Bug description

the generated file imports interfaces from the existing ts file without the .js extension which throws the error

Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'.

Input

// typescript type or interface causing the output

Expected output

import {
  type CatalogTemplate,
} from "./KyRbApi.jd";

Actual output

import {
  type CatalogTemplate,
} from "./KyRbApi";

Versions

  • Typescript: v5.9.2
  • Zod: v4.1.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions