I'm using 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"]
}
I get the following Typescript error:
Cannot invoke an expression whose type lacks a call signature. Type 'typeof import(".../node_modules/next/types/index")' has no compatible call signatures.
I can't understand what's going on here. Can anyone help explain this error and why one of the core functions for this popular package throws it? Do I need to manually extend some Next types for something that's missing?