Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Assume rootDir is the current configuration directory#62418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
sheetalkamat wants to merge10 commits intomain
base:main
Choose a base branch
Loading
fromrootDir
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Update the error message
  • Loading branch information
@sheetalkamat
sheetalkamat committedOct 3, 2025
commitcbb10d2707829f0f88df24125249a051900bd319

Some comments aren't visible on the classic Files Changed page.

2 changes: 1 addition & 1 deletionsrc/compiler/diagnosticMessages.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4469,7 +4469,7 @@
"category": "Error",
"code": 5010
},
"Inferred common source directorydiffers from tsconfig directory, output layout willbechanged.": {
"The common source directoryof '{0}' is '{1}'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.": {
"category": "Error",
"code": 5011
},
Expand Down
5 changes: 4 additions & 1 deletionsrc/compiler/program.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -133,6 +133,7 @@ import {
getPackageScopeForPath,
getPathFromPathComponents,
getPositionOfLineAndCharacter,
getRelativePathFromFile,
getResolvedModuleFromResolution,
getResolvedTypeReferenceDirectiveFromResolution,
getResolveJsonModule,
Expand DownExpand Up@@ -4275,7 +4276,9 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
options.outDir ? "declarationDir" : undefined,
chainDiagnosticMessages(
chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information),
Diagnostics.Inferred_common_source_directory_differs_from_tsconfig_directory_output_layout_will_be_changed,
Diagnostics.The_common_source_directory_of_0_is_1_The_rootDir_setting_must_be_explicitly_set_to_this_or_another_path_to_adjust_your_output_s_file_layout,
getBaseFileName(options.configFilePath),
getRelativePathFromFile(options.configFilePath, dir59, getCanonicalFileName),
),
);
}
Expand Down
4 changes: 2 additions & 2 deletionstests/baselines/reference/commonSourceDirectory.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,7 +32,7 @@ export {};
//// [DtsFileErrors]


/app/tsconfig.json(3,9): error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
/app/tsconfig.json(3,9): error TS5011:The common source directoryof 'tsconfig.json' is '../.src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.


Expand All@@ -41,7 +41,7 @@ export {};
"compilerOptions": {
"outDir": "bin",
~~~~~~~~
!!! error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
!!! error TS5011:The common source directoryof 'tsconfig.json' is '../.src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
!!! error TS5011: Visit https://aka.ms/ts6 for migration information.
"typeRoots": ["../types"],
"sourceMap": true,
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
/app/tsconfig.json(3,9): error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
/app/tsconfig.json(3,9): error TS5011:The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.


Expand All@@ -7,7 +7,7 @@
"compilerOptions": {
"outDir": "bin",
~~~~~~~~
!!! error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
!!! error TS5011:The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
!!! error TS5011: Visit https://aka.ms/ts6 for migration information.
"sourceMap": true,
"mapRoot": "myMapRoot",
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
/tsconfig.json(5,5): error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
/tsconfig.json(5,5): error TS5011:The common source directoryof 'tsconfig.json' is './packages'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.
/tsconfig.json(6,5): error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
Visit https://aka.ms/ts6 for migration information.
Expand All@@ -11,7 +11,7 @@
"declaration": true,
"outDir": "temp",
~~~~~~~~
!!! error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
!!! error TS5011:The common source directoryof 'tsconfig.json' is './packages'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
!!! error TS5011: Visit https://aka.ms/ts6 for migration information.
"baseUrl": "."
~~~~~~~~~
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
packages/b/tsconfig.json(3,9): error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
packages/b/tsconfig.json(3,9): error TS5011:The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.
packages/b/tsconfig.json(5,9): error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
Visit https://aka.ms/ts6 for migration information.
Expand All@@ -9,7 +9,7 @@ packages/b/tsconfig.json(5,9): error TS5101: Option 'baseUrl' is deprecated and
"compilerOptions": {
"outDir": "dist",
~~~~~~~~
!!! error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
!!! error TS5011:The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
!!! error TS5011: Visit https://aka.ms/ts6 for migration information.
"declaration": true,
"baseUrl": ".",
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
packages/lab/tsconfig.json(3,9): error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
packages/lab/tsconfig.json(3,9): error TS5011:The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.
packages/lab/tsconfig.json(5,9): error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
Visit https://aka.ms/ts6 for migration information.
Expand All@@ -9,7 +9,7 @@ packages/lab/tsconfig.json(5,9): error TS5101: Option 'baseUrl' is deprecated an
"compilerOptions": {
"outDir": "dist",
~~~~~~~~
!!! error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
!!! error TS5011:The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
!!! error TS5011: Visit https://aka.ms/ts6 for migration information.
"declaration": true,
"baseUrl": "../",
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,15 +22,15 @@ export default Foo;
//// [DtsFileErrors]


/foo/tsconfig.json(2,47): error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
/foo/tsconfig.json(2,47): error TS5011:The common source directoryof 'tsconfig.json' is '../.src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.


==== /foo/tsconfig.json (1 errors) ====
{
"compilerOptions": { "declaration": true, "declarationDir": "out" }
~~~~~~~~~~~~~~~~
!!! error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
!!! error TS5011:The common source directoryof 'tsconfig.json' is '../.src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
!!! error TS5011: Visit https://aka.ms/ts6 for migration information.
}

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
error TS5055: Cannot write file '/bar.js' because it would overwrite input file.
/root/tsconfig.json(3,9): error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
Visit https://aka.ms/ts6 for migration information.
/root/tsconfig.json(8,9): error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
/root/tsconfig.json(8,9): error TS5011:The common source directoryof 'tsconfig.json' is '..'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.
/root/a.ts(1,21): error TS6059: File '/foo.ts' is not under 'rootDir' '/root'. 'rootDir' is expected to contain all source files.
/root/a.ts(2,21): error TS6059: File '/bar.js' is not under 'rootDir' '/root'. 'rootDir' is expected to contain all source files.
Expand All@@ -21,7 +21,7 @@ error TS5055: Cannot write file '/bar.js' because it would overwrite input file.
"allowJs": true,
"outDir": "bin"
~~~~~~~~
!!! error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
!!! error TS5011:The common source directoryof 'tsconfig.json' is '..'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
!!! error TS5011: Visit https://aka.ms/ts6 for migration information.
}
}
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
error TS5055: Cannot write file '/bar.js' because it would overwrite input file.
/root/tsconfig.json(3,9): error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
Visit https://aka.ms/ts6 for migration information.
/root/tsconfig.json(8,9): error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
/root/tsconfig.json(8,9): error TS5011:The common source directoryof 'tsconfig.json' is '..'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.
/root/a.ts(1,21): error TS6059: File '/foo.ts' is not under 'rootDir' '/root'. 'rootDir' is expected to contain all source files.
/root/a.ts(2,21): error TS6059: File '/bar.js' is not under 'rootDir' '/root'. 'rootDir' is expected to contain all source files.
Expand All@@ -21,7 +21,7 @@ error TS5055: Cannot write file '/bar.js' because it would overwrite input file.
"allowJs": true,
"outDir": "bin"
~~~~~~~~
!!! error TS5011:Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
!!! error TS5011:The common source directoryof 'tsconfig.json' is '..'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Oh, users get this message even with an explicitrootDir? That's a little bit surprising.

I came up with this message only when the common source directory is inferred as something containing therootDir.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

am i missing something. there is no rootDir specified here?

!!! error TS5011: Visit https://aka.ms/ts6 for migration information.
}
}
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,7 @@ Output::

[HH:MM:SS AM] Building project '/home/src/workspaces/project/tsconfig.json'...

tsconfig.json:3:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
tsconfig.json:3:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

3 "outDir": "dist"
Expand DownExpand Up@@ -81,7 +81,7 @@ Output::

[HH:MM:SS AM] Building project '/home/src/workspaces/project/tsconfig.json'...

tsconfig.json:3:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
tsconfig.json:3:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

3 "outDir": "dist"
Expand All@@ -104,7 +104,7 @@ Input::

/home/src/tslibs/TS/Lib/tsc.js -p /home/src/workspaces/project/tsconfig.json
Output::
tsconfig.json:3:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
tsconfig.json:3:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

3 "outDir": "dist"
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -57,7 +57,7 @@ Output::
3 "moduleResolution": "node",
   ~~~~~~

project/tsconfig.json:8:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
project/tsconfig.json:8:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

8 "outDir": "dist",
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -59,7 +59,7 @@ Output::
3 "moduleResolution": "node",
   ~~~~~~

project/tsconfig.json:8:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
project/tsconfig.json:8:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

8 "outDir": "dist",
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -57,7 +57,7 @@ Output::
3 "moduleResolution": "node",
   ~~~~~~

project/tsconfig.json:8:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
project/tsconfig.json:8:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

8 "outDir": "dist",
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -57,7 +57,7 @@ Output::
3 "moduleResolution": "node",
   ~~~~~~

project/tsconfig.json:8:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
project/tsconfig.json:8:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

8 "outDir": "dist",
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,7 +56,7 @@ Output::
3 "moduleResolution": "node",
   ~~~~~~

project/tsconfig.json:8:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
project/tsconfig.json:8:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

8 "outDir": "dist",
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,7 +56,7 @@ Output::
3 "moduleResolution": "node",
   ~~~~~~

project/tsconfig.json:8:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
project/tsconfig.json:8:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

8 "outDir": "dist",
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,7 +58,7 @@ Output::
3 "moduleResolution": "node",
   ~~~~~~

project/tsconfig.json:8:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
project/tsconfig.json:8:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

8 "outDir": "dist",
Expand DownExpand Up@@ -135,7 +135,7 @@ Output::
3 "moduleResolution": "node",
   ~~~~~~

project/tsconfig.json:8:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
project/tsconfig.json:8:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

8 "outDir": "dist",
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -95,7 +95,7 @@ declare const console: { log(msg: any): void; };

D:\home\src\tslibs\TS\Lib\tsc.js -p D:\Work\pkg1 --explainFiles
Output::
tsconfig.json:13:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
tsconfig.json:13:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

13 "outDir": "./dist",
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -316,7 +316,7 @@ Found 'package.json' at '/home/src/projects/component-type-checker/node_modules/
9 "baseUrl": ".",
   ~~~~~~~~~

tsconfig.json:10:5 - error TS5011: Inferred common source directorydiffers fromtsconfig directory, output layout willbechanged.
tsconfig.json:10:5 - error TS5011: The common source directoryof 'tsconfig.json' is './src'. The 'rootDir' setting mustbeexplicitly set to this or another path to adjust your output's file layout.
Visit https://aka.ms/ts6 for migration information.

10 "outDir": "dist"
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp