NextJS 13 project with package that has an inner core dependency (react-leaflet->@react-leaflet/core).
yarn run build
Build fails on "Linting and checking validity of types"
Seems like some typescript compatibility issue regarding import {type MyType}
Link to specific file on dependency
package.json:
{
"dependencies": {
"next": "^13.0.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-leaflet": "^4.2.0",
"leaflet": "^1.9.3"
},
"devDependencies": {
"@types/leaflet": "^1.9.0",
"@types/node": "18.11.17",
"@types/react": "17.0.20",
"eslint": "7.32.0",
"eslint-config-next": "^13.0.7",
"typescript": "4.4.2"
}
}
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
Expecting yarn run build
to compile successfully
Issue resolve:
Resolved by using yarn upgrade --latest
to upgrade typescript
version.