Bug Description
@docusaurus/tsconfig sets "baseUrl": "." in its base config. Starting with TypeScript 6.0, baseUrl is deprecated and triggers a build error:
error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0.
Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
This error surfaces in any Docusaurus project using TypeScript 6.x when running tsc --noEmit.
Root Cause
@docusaurus/tsconfig/tsconfig.json currently contains:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@site/*": ["./*"]
}
}
}
Per the TypeScript 6.0 migration guide, baseUrl was historically required to use paths, but this is no longer the case. The paths entries can simply be kept as-is without baseUrl, or baseUrl can be prepended to each entry.
Expected Behavior
tsc --noEmit passes without errors or deprecation warnings on TypeScript 6.x.
Workaround
Projects can add this to their own tsconfig.json to silence the warning:
{
"extends": "@docusaurus/tsconfig",
"compilerOptions": {
"ignoreDeprecations": "6.0"
}
}
Fix
Remove "baseUrl": "." from @docusaurus/tsconfig/tsconfig.json. The @site/* path alias should continue to work without it (TypeScript no longer requires baseUrl to be set when using paths).
Bug Description
@docusaurus/tsconfigsets"baseUrl": "."in its base config. Starting with TypeScript 6.0,baseUrlis deprecated and triggers a build error:This error surfaces in any Docusaurus project using TypeScript 6.x when running
tsc --noEmit.Root Cause
@docusaurus/tsconfig/tsconfig.jsoncurrently contains:{ "compilerOptions": { "baseUrl": ".", "paths": { "@site/*": ["./*"] } } }Per the TypeScript 6.0 migration guide,
baseUrlwas historically required to usepaths, but this is no longer the case. Thepathsentries can simply be kept as-is withoutbaseUrl, orbaseUrlcan be prepended to each entry.Expected Behavior
tsc --noEmitpasses without errors or deprecation warnings on TypeScript 6.x.Workaround
Projects can add this to their own
tsconfig.jsonto silence the warning:{ "extends": "@docusaurus/tsconfig", "compilerOptions": { "ignoreDeprecations": "6.0" } }Fix
Remove
"baseUrl": "."from@docusaurus/tsconfig/tsconfig.json. The@site/*path alias should continue to work without it (TypeScript no longer requiresbaseUrlto be set when usingpaths).