serverless-plugin-typescript
serverless-plugin-typescript copied to clipboard
Error: [{"messageText":"Unknown compiler option 'incremental'.","category":1,"code":5023}]
Plugin throws an error if "incremental": true
is in your tsconfig.json
This happens by default using Nest.js
The error message is
"Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified.
For now I set the option to false
, but I fear the compilation may become slow over time.
Is there a solution to this error message: Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified?
@GilSnappy try adding to your tsconfig: "tsBuildInfoFile": ".tsbuildinfo"
, it worked for me
It works, thanks! I hoped this would solve my slow compilation time, but it doesn't. Still over 10 seconds. tsconfig:
{
"compilerOptions": {
/* Language and Environment */
"target": "ES2017",
/* Modules */
"module": "commonjs",
"rootDir": ".",
"moduleResolution": "node",
"resolveJsonModule": true,
/* JavaScript Support */
"allowJs": true,
/* Emit */
"declaration": true,
"sourceMap": true,
"outDir": "./dist",
/* Interop Constraints */
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
/* Type Checking */
"strict": true,
"skipLibCheck": true,
"tsBuildInfoFile": ".tsbuildinfo",
"incremental": true
},
"include": ["functions", "utils"],
"exclude": ["node_modules", "__tests__/**"]
}
typescript version 4.5.4 serverless-plugin-typescript version 1.1.7
Any ideas why this should be so slow?
@GilSnappy after further testing I have determined it is not working as intended. In looking at how this plugin sets up the Typescript project it is recreated every time vs being re-used. I would guess this is introducing the increased overhead that we are seeing.
I think that if I remove "tsBuildInfoFile": ".tsbuildinfo", "incremental": true it's the same time, or around that time. Too long :(