My current setup includes the following package versions:
- next v8.1.1-canary.42
- @types/next v8.0.5
server.js
import next from 'next';
const app = next({ dev: isDevelopment });
tsconfig.json
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "preserve",
"lib": ["dom", "es2017"],
"module": "commonjs",
"moduleResolution": "node",
"noEmit": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"removeComments": true,
"resolveJsonModule": true,
"sourceMap": true,
"strict": true,
"target": "esnext"
},
"exclude": ["node_modules"]
}
An error occurs in TypeScript with the message:
Cannot invoke an expression whose type lacks a call signature. Type 'typeof import(".../node_modules/next/types/index")' has no compatible call signatures.
I am puzzled by this Typescript error. Can someone provide insight into why this error is happening and whether any manual adjustments to Next types are required?