You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ tsc -p ./tsconfig.json --traceResolution
======== Resolving module 'foo' from '/***/work/src/index.ts'. ========
Module resolution kind is not specified, using 'NodeJs'.
Loading module 'foo' from 'node_modules' folder.
File '/***/word/src/node_modules/foo.ts' does not exist.
...omit...
File '/node_modules/foo/index.jsx' does not exist.
======== Module name 'foo' was not resolved. ========
======== Resolving type reference directive 'foo', containing file '/***/work/__inferred type names__.ts', root directory '/***/work/typings'. ========
Resolving with primary search path '/***/work/typings'
File '/***/work/typings/foo/package.json' does not exist.
File '/***/work/typings/foo/index.d.ts' exist - use it as a name resolution result.
Resolving real path for '/***/work/typings/foo/index.d.ts', result '/***/work/typings/foo/index.d.ts'
======== Type reference directive 'foo' was successfully resolved to '/***/work/typings/foo/index.d.ts', primary: true. ========
src/index.ts(1,20): error TS2307: Cannot find module 'foo'.
tsc can find typings/foo/index.d.ts , but compile was failed...
Expected behavior:
compile successful.
I expect "typeRoots": [] and "typeRoots: ["./node_modules/@types/"]" are equivalent.
I hope I want to use "typeRoots: ["./node_modules/@types/", "./typings/"]"
typeRoots are only used to resolve /// <reference types=".." /> directives. if you want to import it, then just use baseUrl or add a path mapping entry. you do not need typeRoots in this case.
I want to try to use
@types
like repository.TypeScript Version: Version 2.2.0-dev.20161114
Code
tsc can find typings/foo/index.d.ts , but compile was failed...
Expected behavior:
compile successful.
I expect
"typeRoots": []
and"typeRoots: ["./node_modules/@types/"]"
are equivalent.I hope I want to use
"typeRoots: ["./node_modules/@types/", "./typings/"]"
Actual behavior:
compile failure.
I read wiki, handbook.
related? #11329 #11137
The text was updated successfully, but these errors were encountered: