In my project setup, I have a mono-repo structure utilizing Lerna
for managing 2 NextJS projects and 1 shared project.
I recently attempted to integrate typescript. The NextJS projects seem to be functioning correctly (following the documentation), but I encountered an issue while compiling the other project.
Here are the package versions:
"next": "^12.0.1",
"typescript": "^4.6.2"
This is the TypeScript configuration (tsconfig.json
):
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": false,
"target": "es6",
"noImplicitAny": true,
"moduleResolution": "node",
"sourceMap": false,
"outDir": "dist",
"allowJs": true,
"baseUrl": ".",
"incremental": true,
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"exclude": [
"dist",
"jest.*.js",
]
}
The encountered error message is as follows:
../../node_modules/next/types/index.d.ts:203:5
error TS2386: Overload signatures must all be optional or required.
203:5 randomUUID?(): string