Skip to content

bug: re-open of issue #2769 / components.d.ts missing types #3239

Open
@stanley85

Description

@stanley85

Stencil version:

Current behavior:
The behaviour is best documented in the closed ticket (by bot due to inactivity) the Issue remains un-solved - please have a look at #2769

Copycat:
If there is no src/components.d.ts file present, and one component (A) references another's type (B)...

On first build, the types are not generated for (A) in the output directory dist/types/components. If (A) exports any types, this can also result in broken imports in dist/types/components.d.ts. No error is reported during build.

On second build (where there is now a src/components.d.ts present as a result of the first build), the types are generated for (A) in the output directory dist/types/components.

I do not like committing auto-generated files to source control, as they result in needless churn, hence why i do not have src/components.d.ts (this was a fresh clone of my repo).

Expected behavior:
All Types are present in the first compile of components.d.ts, when no components.d.ts is present in the first place.

Copycat:
Ideally it should Just Work(tm), and not rely on committing auto-generated files to source control. On both the first (broken) build and the second (successful) build, the src/components.d.ts file is exactly the same, so it may be a timing/ordering issue?

An alternative would simply be to raise an error in this case.

Steps to reproduce:

  1. create new stencil project with npm init stencil
  2. rm src/components.d.ts
  3. add the components from the Related code section below
  4. npm run build
  5. open dist/types/components.d.ts and see a broken import
  6. ls dist/types/components/ and notice there are no types for my-other-component

Related code:
please have a look at #2769

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: ValidatedThis PR or Issue is verified to be a bug within Stencil

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions