Preact-cli: ForkTSCheckerWebpackPlugin given wrong API schema

Created on 27 May 2021  Â·  5Comments  Â·  Source: preactjs/preact-cli

Hello :)

What is the current behaviour?
Build is not completed due to a validation error.

Steps to Reproduce
Run preact build from a terminal on a Preact project.

What is the expected behaviour?
Build is completed without errors.

Please mention any other relevant information
The error is this:

✖ ERROR ValidationError: Invalid configuration object. ForkTsCheckerWebpackPlugin has been initialized using a configuration object that does not match the API schema.
 - configuration has an unknown property 'silent'. These properties are valid:
   object { async?, typescript?, eslint?, formatter?, issue?, logger? }

And continues with the error trace.

Project is using webpack 4, and Typescript 4.2.4.

It was not happening a week before. Nothing from the code has changed.

So the error has come with preact-cli v3.2.0. With v3.1.0 is working as expected.

tsconfig.js file

{
  "compilerOptions": {
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "jsx": "preserve",
    "jsxImportSource": "preact",
    "jsxFactory": "h",
    "jsxFragmentFactory": "Fragment",
    "lib": ["dom", "esnext"],
    "moduleResolution": "node",
    "noEmit": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "preserveConstEnums": true,
    "removeComments": false,
    "skipLibCheck": true,
    "sourceMap": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "esModuleInterop": true,
    "resolveJsonModule": true,
    "isolatedModules": true
  },
  "exclude": ["build/**/*", "node_modules/**/*.*"],
  "include": ["**/*.ts", "**/*.tsx"]
}
Environment Info:
  System:
    OS: macOS 11.3.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 15.2.1 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.11.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 90.0.4430.212
    Firefox: 87.0
    Safari: 14.1
  npmPackages:
    preact: 10.5.13 => 10.5.13 
    preact-cli: ^3.2.0 => 3.2.0 
    preact-render-to-string: 5.1.19 => 5.1.19

Most helpful comment

Yeah it's an issue from #1465. I'll try to get that corrected tomorrow morning. I guess we don't have TS tests so this slipped through. Sorry about that.

All 5 comments

Yeah it's an issue from #1465. I'll try to get that corrected tomorrow morning. I guess we don't have TS tests so this slipped through. Sorry about that.

I didn't forget about this, but after fixing the config the plugin completely locks up the build process. Not really sure what's going on there or if it's an upstream issue.

Maybe a revert would be easier? Until it's resolved, as 3.2 version because of this is completely broken for me

We did revert in #1567.

You should be able to use your preact.config.js to remove the plugin I believe if you can't wait.

Closing as the fix has been merged

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hesselbom picture hesselbom  Â·  3Comments

raphaelbauer picture raphaelbauer  Â·  3Comments

thangngoc89 picture thangngoc89  Â·  3Comments

oren picture oren  Â·  4Comments

jpoo90 picture jpoo90  Â·  4Comments