Skip to content

Extensionless imports broken under 'composite project' builds #1021

@davidtaylorhq

Description

@davidtaylorhq

Typescript supports extensionless imports like this:

import MyComponent from "./my-component";

This works for gts/gjs targets in Glint under Typescript's default project mode:

❯ pnpm ember-tsc -p . 
# ✅ succeeds

However, when running using Typescript's --build mode, extensionless imports of .gjs and .gts files fail to resolve. Extensionless imports of .js and .ts files continue working.

❯ pnpm ember-tsc -b  
js-entry.js:3:27 - error TS2307: Cannot find module './my-js-component' or its corresponding type declarations.

3 import MyJsComponent from "./my-js-component";
                            ~~~~~~~~~~~~~~~~~~~

ts-entry.ts:1:27 - error TS2307: Cannot find module './my-ts-component' or its corresponding type declarations.

1 import MyTsComponent from "./my-ts-component";
                            ~~~~~~~~~~~~~~~~~~~


Found 2 errors.

Full reproduction here: https://github.com/davidtaylorhq/glint-project-test

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