Skip to content

bug: TypeScript errors not reported in stencil build when components.d.ts is not present #3534

@ethanbdev

Description

@ethanbdev

Prerequisites

Stencil Version

v2.17.3 (Seen in at least 2.16.1 as well)

Current Behavior

Type errors are not erroring on initial builds (no build outputs), but will on subsequent builds.

This is an issue especially in CI, as we re-create the entire environment. The CI workflow will not error if a type error is committed.

Expected Behavior

The type error should cause the build to error

Steps to Reproduce

  1. Clone the stencil starter
  2. Delete components.d.ts
  3. Change the exports in index.ts to be named or export * from ./components or delete index.ts
  4. Make a type error somewhere
  5. npm run build -> build completes with no errors

OR

  1. In a project that does not commit the components.d.ts, simply delete it, and note that the type error will not be reported.
    (I have provided a repo that matches our setup)

image

Code Reproduction URL

https://github.com/ethanbdev/stencil-typings-error-repro

Additional Information

It seems extremely breaking that we cannot rely on the types generated in an initial build.

One additional thing I noticed, in the stencil starter if the components.d.ts gets deleted, the build does not even work with a different error about the ./components file is not found

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