fork-ts-checker-notifier-webpack-plugin icon indicating copy to clipboard operation
fork-ts-checker-notifier-webpack-plugin copied to clipboard

Update plugin to support fork-ts-checker@5

Open sanex3339 opened this issue 4 years ago • 4 comments

Currently, this plugin failed on fork-ts-checker-webpack-plugin@5 with error:

Error: Error: TypeError: Cannot read property 'tap' of undefined

sanex3339 avatar Jun 13 '20 17:06 sanex3339

v5 is pretty new; I think it shipped only yesterday.

If you'd like to submit a PR to make this v5 compatible that'd be greatly appreciated!

You may want to use the v5 PR for reference: https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/pull/445

johnnyreilly avatar Jun 13 '20 20:06 johnnyreilly

Looking at the plugin I think the hooks have changed. Probably we need to hook into issues now in place of receive here: https://github.com/johnnyreilly/fork-ts-checker-notifier-webpack-plugin/blob/master/index.ts#L107

Based upon the docs here:

https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/master/README.md#plugin-hooks

See also: https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/232#issuecomment-645543747

johnnyreilly avatar Jun 14 '20 05:06 johnnyreilly

node.js: v14.4.0 npm: v6.14.5 webpack: v4.43.0 fork-ts-checker-webpack-plugin: v5.0.1 fork-ts-checker-notifier-webpack-plugin: v2.0.0 Windows 10 professional edition 1902 18363.900

image

(node:4280) UnhandledPromiseRejectionWarning: TypeError: lints is not iterable at ForkTsCheckerNotifierWebpackPlugin.compilationDone (G:\WebStormWS\WebProTpl\node_modules\fork-ts-checker-notifier-webpack-plugin\index.js:10:75) at SyncWaterfallHook.eval [as call] (eval at create (G:\WebStormWS\WebProTpl\node_modules\tapable\lib\HookCodeFactory.js:19:10), :7:16) at SyncWaterfallHook.lazyCompileHook (G:\WebStormWS\WebProTpl\node_modules\tapable\lib\Hook.js:154:20) at Object. (G:\WebStormWS\WebProTpl\node_modules\fork-ts-checker-webpack-plugin\lib\hooks\tapDoneToAsyncGetIssues.js:61:31) at Generator.next () at fulfilled (G:\WebStormWS\WebProTpl\node_modules\fork-ts-checker-webpack-plugin\lib\hooks\tapDoneToAsyncGetIssues.js:5:58) (Use node --trace-warnings ... to show where the warning was created) (node:4280) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:4280) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

LP1994 avatar Jun 18 '20 03:06 LP1994

ForkTsCheckerWebpackPlugin_obj = {
    async: true,
    typescript: {
        enabled: true,
        memoryLimit: 4096,
        configFile: path.resolve( __dirname, './tsconfig.json' ),
        build: false,
        mode: 'write-tsbuildinfo',
        diagnosticsOptions: {
            syntactic: true,
            semantic: true,
            declaration: true,
            global: true,
        },
        extensions: {
            vue: {
                enabled: true,
                compiler: 'vue-template-compiler',
            },
        },
        profile: false,
    },
    eslint: undefined,
    issue: {
        include: undefined,
        exclude: undefined,
        scope: 'all',
    },
    logger: {
        infrastructure: 'silent',
        issues: 'console',
    },
},
ForkTsCheckerNotifierWebpackPlugin_obj = {
    title: 'WebpackNotice2020',
    excludeWarnings: true,
    alwaysNotify: false,
    skipFirstNotification: true,
    skipSuccessful: true,
},

LP1994 avatar Jun 18 '20 06:06 LP1994