Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Typescript errors don't break build #33

Open

Description

When using @babel/preset-typescript with babel-loader (webpack), a typescript error does not break the build. It compiles no matter what which renders typescript useless. When using just webpack and ts-loader I get the desired result of seeing errors in the terminal and a broken build when there is a typescript issue. Is this the intended behavior using typescript and babel in webpack ?

Activity

  1. changed the title [-]Typescript errors don't error in build[/-] [+]Typescript errors don't break build[/+] on Jan 28, 2019
  2. johnknoop commented on Jan 31, 2019

    @johnknoop

    Ben Bissonnette (@benjamingeorge) That is the intended behaviour. Babel just strips all the ts-stuff out. That's why you need the manual typechecking as well.

  3. gilamran commented on Feb 1, 2019

    @gilamran
    Contributor

    Sounds like a bad plan... Would you want to build your C#/C++ project without type checking?
    In my opinion, TypeScript should stop the build on error.

  4. juanpicado commented on Mar 12, 2019

    @juanpicado

    Does anyone know whether there is a way to break the build or display warnings in build time (webpack)?

  5. frankandrobot commented on Apr 24, 2019

    @frankandrobot
  6. juanpicado commented on May 9, 2019

    @juanpicado

    Uriel Avalos (@frankandrobot) I've been testing that plugin for a while and seems run the type checking in parallel and not in sync with the webpack process. Sometimes throws errors before webpck finish the hot reload build. It helps, but not the definitive solution.

  7. MonkeyDo commented on Dec 10, 2020

    @MonkeyDo

    Here's another plugin that can achieve the same result: fork-ts-checker-webpack-plugin

  8. nyngwang commented on Apr 7, 2022

    @nyngwang

    Gil Amran (@gilamran): If you are a JS library maintainer, do you want to see your library fails to build during the migration? I don't think you get the point of what John Knoop (@johnknoop) was saying.

    [...] When using just webpack and ts-loader I get the desired result of seeing errors in the terminal and a broken build when there is a typescript issue. [...]

    This is just an additional feature that ts-loader provides. The point of TypeScript is you don't need to do it right at once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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