Skip to content

Bundlers loaders are not utilising diagnostics produced by transformer plugins via ts-patch addDiagnostic utility #139

@artem1458

Description

@artem1458

When using webpack with ts-loader and ts-patch - diagnostics produced by transformer plugin is not utilised, the result - compilation is not failing even with reported diagnostics with severity ERROR. Same issue appears when using vite with rollup-plugin-typescript2 and ts-patch.
This issue appears in both ts-patch modes - Live Compiler and Persistent Patch.

When using tsc or or tspc diagnostics is utilised and failing compilation as expected.

Minimal reproduction repo: https://github.com/artem1458/ts-patch-webpack

Output from build:tsc script (failed as expected):

Custom transformer is working
src/index.ts:1:7 - error TS1: MyCustomTransformationError

1 class Foo {}
        ~~~


Found 1 error in src/index.ts:1

Output from build:webpack script (not failing build):

Custom transformer is working

Custom transformer is working
asset main.js 1.23 KiB [emitted] (name: main)
./src/index.ts 28 bytes [built] [code generated]
webpack 5.89.0 compiled successfully in 725 ms

Output from build:vite script (not failing build):

vite v5.0.5 building for production...
transforming (1) index.html
Custom transformer is working
✓ 3 modules transformed.
dist/index.html                0.40 kB │ gzip: 0.27 kB
dist/assets/index-0d4UnAVa.js  1.57 kB │ gzip: 0.59 kB
✓ built in 632ms

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions