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
After bumping a vavite dev-dependency from 1.7.0 to 2.0.2 tsc --noEmit suddenly fails to resolve the *.d.ts file for imports of vavite:
> tsc --noEmit
vite.config.ts:2:20 - error TS2307: Cannot find module 'vavite' or its corresponding type declarations.
2 import vavite from "vavite";
vavite itself still successfully manages to build the project.
With tsc --noEmit --traceResolution it seems like it incorrectly attempts to load type-definitions from dist/dist/index.cjs.d.ts, instead of dist/index.d.ts:
======== Resolving module 'vavite' from '/testproject/vite.config.ts'. ========
Explicitly specified module resolution kind: 'Node10'.
'paths' option is specified, looking for a pattern to match module name 'vavite'.
Loading module 'vavite' from 'node_modules' folder, target file types: TypeScript, Declaration.
Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
Found 'package.json' at '/testproject/node_modules/vavite/package.json'.
File '/testproject/node_modules/vavite.ts' does not exist.
File '/testproject/node_modules/vavite.tsx' does not exist.
File '/testproject/node_modules/vavite.d.ts' does not exist.
'package.json' has a 'typesVersions' field with version-specific path mappings.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
'package.json' has 'main' field './dist/index.cjs' that references '/testproject/node_modules/vavite/dist/index.cjs'.
'package.json' has a 'typesVersions' entry '*' that matches compiler version '5.2.2', looking for a pattern to match module name 'dist/index.cjs'.
Module name 'dist/index.cjs', matched pattern '*'.
Trying substitution 'dist/*.d.ts', candidate module location: 'dist/dist/index.cjs.d.ts'.
File '/testproject/node_modules/vavite/dist/dist/index.cjs.d.ts' does not exist.
Loading module as file / folder, candidate module location '/testproject/node_modules/vavite/dist/dist/index.cjs.d.ts', target file types: TypeScript, Declaration.
File name '/testproject/node_modules/vavite/dist/dist/index.cjs.d.ts' has a '.d.ts' extension - stripping it.
File '/testproject/node_modules/@types/vavite.d.ts' does not exist.
Directory '/node_modules' does not exist, skipping all lookups in it.
'paths' option is specified, looking for a pattern to match module name 'vavite'.
Loading module 'vavite' from 'node_modules' folder, target file types: JavaScript.
Searching all ancestor node_modules directories for fallback extensions: JavaScript.
File '/testproject/node_modules/vavite/package.json' exists according to earlier cached lookups.
File '/testproject/node_modules/vavite.js' does not exist.
File '/testproject/node_modules/vavite.jsx' does not exist.
'package.json' has 'main' field './dist/index.cjs' that references '/testproject/node_modules/vavite/dist/index.cjs'.
'package.json' has a 'typesVersions' entry '*' that matches compiler version '5.2.2', looking for a pattern to match module name 'dist/index.cjs'.
Module name 'dist/index.cjs', matched pattern '*'.
Trying substitution 'dist/*.d.ts', candidate module location: 'dist/dist/index.cjs.d.ts'.
File '/testproject/node_modules/vavite/dist/dist/index.cjs.d.ts' does not exist.
Loading module as file / folder, candidate module location '/testproject/node_modules/vavite/dist/dist/index.cjs.d.ts', target file types: JavaScript.
File name '/testproject/node_modules/vavite/dist/dist/index.cjs.d.ts' has a '.d.ts' extension - stripping it.
Directory '/node_modules' does not exist, skipping all lookups in it.
======== Module name 'vavite' was not resolved. ========
My guess is that the addition of the typesVersions in cf2574a is the culprit.
The text was updated successfully, but these errors were encountered:
After bumping a vavite dev-dependency from 1.7.0 to 2.0.2
tsc --noEmit
suddenly fails to resolve the*.d.ts
file for imports ofvavite
:vavite
itself still successfully manages to build the project.With
tsc --noEmit --traceResolution
it seems like it incorrectly attempts to load type-definitions fromdist/dist/index.cjs.d.ts
, instead ofdist/index.d.ts
:My guess is that the addition of the
typesVersions
in cf2574a is the culprit.The text was updated successfully, but these errors were encountered: