Skip to content

Missing file extension in relative import path in zenstack/models.ts #392

@herberthobregon

Description

@herberthobregon

Description and expected behavior
The file zenstack/models.ts contains a relative import that is missing the .js file extension.
File: zenstack/models.ts

import { type SchemaType as $Schema } from "./schema";

When the TypeScript compiler moduleResolution option is set to 'node16' or 'nodenext', explicit file extensions are required for relative ECMAScript module imports. This causes the following TypeScript error:

Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './schema.js'? ts(2835)

Proposed Solution
The import statement should be updated to include the .js extension.

import { type SchemaType as $Schema } from "./schema.js";

This change will make the import path explicit and resolve the compilation error.

  • ZenStack version: 3.0.0-beta.21
  • Database type: Postgresql

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions