Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
error TS6504: File '/node_modules/foo/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?
The file is in the program because:
Root file specified for compilation


!!! error TS6504: File '/node_modules/foo/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?
!!! error TS6504: The file is in the program because:
!!! error TS6504: Root file specified for compilation
==== /node_modules/foo/package.json (0 errors) ====
{
"name": "foo",
"version": "1.0.0",
"exports": {
"types": null,
"require": "./index.js"
}
}

==== /node_modules/foo/index.js (0 errors) ====
module.exports = { a: 'a' };

==== /node_modules/foo/index.d.ts (0 errors) ====
export declare const a: 'a'

==== /a.ts (0 errors) ====
export { a } from "foo";


Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[
"Found 'package.json' at '/node_modules/foo/package.json'.",
"File '/package.json' does not exist.",
"======== Resolving module 'foo' from '/a.ts'. ========",
"Explicitly specified module resolution kind: 'Node16'.",
"Resolving in CJS mode with conditions 'require', 'types', 'node'.",
"File '/package.json' does not exist according to earlier cached lookups.",
"Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.",
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
"Entering conditional exports.",
"Matched 'exports' condition 'types'.",
"package.json scope '/node_modules/foo' explicitly maps specifier '.' to null.",
"Failed to resolve under condition 'types'.",
"Matched 'exports' condition 'require'.",
"Using 'exports' subpath '.' with target './index.js'.",
"File name '/node_modules/foo/index.js' has a '.js' extension - stripping it.",
"File '/node_modules/foo/index.ts' does not exist.",
"File '/node_modules/foo/index.tsx' does not exist.",
"File '/node_modules/foo/index.d.ts' exists - use it as a name resolution result.",
"Resolved under condition 'require'.",
"Exiting conditional exports.",
"Resolving real path for '/node_modules/foo/index.d.ts', result '/node_modules/foo/index.d.ts'.",
"======== Module name 'foo' was successfully resolved to '/node_modules/foo/index.d.ts' with Package ID 'foo/index.d.ts@1.0.0'. ========",
"File 'package.json' does not exist.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-es5' from '__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.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-es5'",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-es5'",
"Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: JavaScript.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-es5' was not resolved. ========",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-decorators' from '__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-decorators'",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-decorators'",
"Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: JavaScript.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-decorators' was not resolved. ========",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-decorators/legacy' from '__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-decorators/legacy'",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-decorators/legacy'",
"Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: JavaScript.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-dom' from '__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-dom'",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-dom'",
"Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: JavaScript.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-dom' was not resolved. ========",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-webworker/importscripts' from '__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-webworker/importscripts'",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-webworker/importscripts'",
"Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: JavaScript.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-scripthost' from '__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-scripthost'",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-scripthost'",
"Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-scripthost' was not resolved. ========",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups."
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
error TS6504: File '/node_modules/foo/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?
The file is in the program because:
Root file specified for compilation


!!! error TS6504: File '/node_modules/foo/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?
!!! error TS6504: The file is in the program because:
!!! error TS6504: Root file specified for compilation
==== /node_modules/foo/package.json (0 errors) ====
{
"name": "foo",
"version": "1.0.0",
"exports": {
"types": null,
"require": "./index.js"
}
}

==== /node_modules/foo/index.js (0 errors) ====
module.exports = { a: 'a' };

==== /node_modules/foo/index.d.ts (0 errors) ====
export declare const a: 'a'

==== /a.ts (0 errors) ====
export { a } from "foo";


Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[
"Found 'package.json' at '/node_modules/foo/package.json'.",
"File '/package.json' does not exist.",
"======== Resolving module 'foo' from '/a.ts'. ========",
"Explicitly specified module resolution kind: 'NodeNext'.",
"Resolving in CJS mode with conditions 'require', 'types', 'node'.",
"File '/package.json' does not exist according to earlier cached lookups.",
"Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.",
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
"Entering conditional exports.",
"Matched 'exports' condition 'types'.",
"package.json scope '/node_modules/foo' explicitly maps specifier '.' to null.",
"Failed to resolve under condition 'types'.",
"Matched 'exports' condition 'require'.",
"Using 'exports' subpath '.' with target './index.js'.",
"File name '/node_modules/foo/index.js' has a '.js' extension - stripping it.",
"File '/node_modules/foo/index.ts' does not exist.",
"File '/node_modules/foo/index.tsx' does not exist.",
"File '/node_modules/foo/index.d.ts' exists - use it as a name resolution result.",
"Resolved under condition 'require'.",
"Exiting conditional exports.",
"Resolving real path for '/node_modules/foo/index.d.ts', result '/node_modules/foo/index.d.ts'.",
"======== Module name 'foo' was successfully resolved to '/node_modules/foo/index.d.ts' with Package ID 'foo/index.d.ts@1.0.0'. ========",
"File 'package.json' does not exist.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-es5' from '__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.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-es5'",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-es5'",
"Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: JavaScript.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-es5' was not resolved. ========",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-decorators' from '__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-decorators'",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-decorators'",
"Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: JavaScript.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-decorators' was not resolved. ========",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-decorators/legacy' from '__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-decorators/legacy'",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-decorators/legacy'",
"Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: JavaScript.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-dom' from '__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-dom'",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-dom'",
"Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: JavaScript.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-dom' was not resolved. ========",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-webworker/importscripts' from '__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-webworker/importscripts'",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-webworker/importscripts'",
"Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: JavaScript.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups.",
"======== Resolving module '@typescript/lib-scripthost' from '__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========",
"Explicitly specified module resolution kind: 'Node10'.",
"Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-scripthost'",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Scoped package detected, looking in 'typescript__lib-scripthost'",
"Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.",
"Directory 'node_modules' does not exist, skipping all lookups in it.",
"======== Module name '@typescript/lib-scripthost' was not resolved. ========",
"File 'package.json' does not exist according to earlier cached lookups.",
"File '/package.json' does not exist according to earlier cached lookups."
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// @noEmit: true
// @moduleResolution: node16,nodenext
// @noTypesAndSymbols: true
// @traceResolution: true

// @filename: /node_modules/foo/package.json
{
"name": "foo",
"version": "1.0.0",
"exports": {
"types": null,
"require": "./index.js"
}
}

// @filename: /node_modules/foo/index.js
module.exports = { a: 'a' };

// @filename: /node_modules/foo/index.d.ts
export declare const a: 'a'

// @filename: /a.ts
export { a } from "foo";

Loading