Skip to content
Open
Show file tree
Hide file tree
Changes from 1 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
1 change: 1 addition & 0 deletions src/compiler/moduleNameResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2818,6 +2818,7 @@ function getLoadModuleFromTargetExportOrImport(extensions: Extensions, state: Mo
}
else {
traceIfEnabled(state, Diagnostics.Failed_to_resolve_under_condition_0, condition);
return { value: undefined };
}
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,35 @@
"File '/node_modules/dep/dist/index.mts' does not exist.",
"File '/node_modules/dep/dist/index.d.mts' does not exist.",
"Failed to resolve under condition 'import'.",
"Saw non-matching condition 'require'.",
"Matched 'exports' condition 'types'.",
"Using 'exports' subpath '.' with target './dist/index.d.ts'.",
"File '/node_modules/dep/dist/index.d.ts' exists - use it as a name resolution result.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Searching all ancestor node_modules directories for fallback extensions: JavaScript, JSON.",
"File '/node_modules/dep/package.json' exists according to earlier cached lookups.",
"Entering conditional exports.",
"Matched 'exports' condition 'import'.",
"Using 'exports' subpath '.' with target './dist/index.mjs'.",
"File name '/node_modules/dep/dist/index.mjs' has a '.mjs' extension - stripping it.",
"File '/node_modules/dep/dist/index.mjs' exists - use it as a name resolution result.",
"'package.json' does not have a 'peerDependencies' field.",
"Resolved under condition 'types'.",
"Resolved under condition 'import'.",
"Exiting conditional exports.",
"Resolving real path for '/node_modules/dep/dist/index.d.ts', result '/node_modules/dep/dist/index.d.ts'.",
"======== Module name 'dep' was successfully resolved to '/node_modules/dep/dist/index.d.ts' with Package ID 'dep/dist/[email protected]'. ========",
"Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update.",
"File '/package.json' does not exist according to earlier cached lookups.",
"Loading module 'dep' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
"File '/node_modules/dep/package.json' exists according to earlier cached lookups.",
"File '/node_modules/dep.ts' does not exist.",
"File '/node_modules/dep.tsx' does not exist.",
"File '/node_modules/dep.d.ts' does not exist.",
"'package.json' does not have a 'typesVersions' field.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' does not have a 'main' field.",
"File '/node_modules/dep/index.ts' does not exist.",
"File '/node_modules/dep/index.tsx' does not exist.",
"File '/node_modules/dep/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Resolving real path for '/node_modules/dep/dist/index.mjs', result '/node_modules/dep/dist/index.mjs'.",
"======== Module name 'dep' was successfully resolved to '/node_modules/dep/dist/index.mjs' with Package ID 'dep/dist/[email protected]'. ========",
"======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, Declaration.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,4 @@ error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolut
export {};

==== /index.mts (0 errors) ====
import {} from "dep";
// Should be an untyped resolution to dep/dist/index.mjs,
// but the first search is only for TS files, and when
// there's no dist/index.d.mts, it continues looking for
// matching conditions and resolves via `types`.

import {} from "dep";
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,29 @@
"File '/node_modules/dep/dist/index.mts' does not exist.",
"File '/node_modules/dep/dist/index.d.mts' does not exist.",
"Failed to resolve under condition 'import'.",
"Saw non-matching condition 'require'.",
"Matched 'exports' condition 'types'.",
"Using 'exports' subpath '.' with target './dist/index.d.ts'.",
"File '/node_modules/dep/dist/index.d.ts' exists - use it as a name resolution result.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
"File '/node_modules/dep/package.json' exists according to earlier cached lookups.",
"Entering conditional exports.",
"Matched 'exports' condition 'import'.",
"Using 'exports' subpath '.' with target './dist/index.mjs'.",
"File name '/node_modules/dep/dist/index.mjs' has a '.mjs' extension - stripping it.",
"File '/node_modules/dep/dist/index.mjs' exists - use it as a name resolution result.",
"'package.json' does not have a 'peerDependencies' field.",
"Resolved under condition 'types'.",
"Resolved under condition 'import'.",
"Exiting conditional exports.",
"Resolving real path for '/node_modules/dep/dist/index.d.ts', result '/node_modules/dep/dist/index.d.ts'.",
"======== Module name 'dep' was successfully resolved to '/node_modules/dep/dist/index.d.ts' with Package ID 'dep/dist/[email protected]'. ========",
"Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update.",
"File '/package.json' does not exist according to earlier cached lookups.",
"Loading module 'dep' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
"File '/node_modules/dep/package.json' exists according to earlier cached lookups.",
"'package.json' does not have a 'typesVersions' field.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' does not have a 'main' field.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Resolving real path for '/node_modules/dep/dist/index.mjs', result '/node_modules/dep/dist/index.mjs'.",
"======== Module name 'dep' was successfully resolved to '/node_modules/dep/dist/index.mjs' with Package ID 'dep/dist/[email protected]'. ========",
"File '/.ts/package.json' does not exist.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,4 @@ error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResol
export {};

==== /index.mts (0 errors) ====
import {} from "dep";
// Should be an untyped resolution to dep/dist/index.mjs,
// but the first search is only for TS files, and when
// there's no dist/index.d.mts, it continues looking for
// matching conditions and resolves via `types`.

import {} from "dep";
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,29 @@
"File '/node_modules/dep/dist/index.mts' does not exist.",
"File '/node_modules/dep/dist/index.d.mts' does not exist.",
"Failed to resolve under condition 'import'.",
"Saw non-matching condition 'require'.",
"Matched 'exports' condition 'types'.",
"Using 'exports' subpath '.' with target './dist/index.d.ts'.",
"File '/node_modules/dep/dist/index.d.ts' exists - use it as a name resolution result.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Searching all ancestor node_modules directories for fallback extensions: JavaScript.",
"File '/node_modules/dep/package.json' exists according to earlier cached lookups.",
"Entering conditional exports.",
"Matched 'exports' condition 'import'.",
"Using 'exports' subpath '.' with target './dist/index.mjs'.",
"File name '/node_modules/dep/dist/index.mjs' has a '.mjs' extension - stripping it.",
"File '/node_modules/dep/dist/index.mjs' exists - use it as a name resolution result.",
"'package.json' does not have a 'peerDependencies' field.",
"Resolved under condition 'types'.",
"Resolved under condition 'import'.",
"Exiting conditional exports.",
"Resolving real path for '/node_modules/dep/dist/index.d.ts', result '/node_modules/dep/dist/index.d.ts'.",
"======== Module name 'dep' was successfully resolved to '/node_modules/dep/dist/index.d.ts' with Package ID 'dep/dist/[email protected]'. ========",
"Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update.",
"File '/package.json' does not exist according to earlier cached lookups.",
"Loading module 'dep' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.",
"File '/node_modules/dep/package.json' exists according to earlier cached lookups.",
"'package.json' does not have a 'typesVersions' field.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' does not have a 'main' field.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Resolving real path for '/node_modules/dep/dist/index.mjs', result '/node_modules/dep/dist/index.mjs'.",
"======== Module name 'dep' was successfully resolved to '/node_modules/dep/dist/index.mjs' with Package ID 'dep/dist/[email protected]'. ========",
"File '/.ts/package.json' does not exist.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,4 @@ export {};
export {};

// @Filename: /index.mts
import {} from "dep";
// Should be an untyped resolution to dep/dist/index.mjs,
// but the first search is only for TS files, and when
// there's no dist/index.d.mts, it continues looking for
// matching conditions and resolves via `types`.
import {} from "dep";
Loading