Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS can't find package types of v5 #152

Closed
mikestopcontinues opened this issue Aug 8, 2024 · 2 comments
Closed

TS can't find package types of v5 #152

mikestopcontinues opened this issue Aug 8, 2024 · 2 comments

Comments

@mikestopcontinues
Copy link

mikestopcontinues commented Aug 8, 2024

After upgrading, typescript can no longer find the proper types.

import tsconfigPlugin from 'vite-tsconfig-paths';
Cannot find module 'vite-tsconfig-paths' or its corresponding type declarations.
  There are types at '/Users/mike/Code/@browsercat/core/tools/vite-config/node_modules/vite-tsconfig-paths/dist/index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.ts(2307)

I can fix the error by changing "module" to "preserve", but that causes other issues in my repo.

I think this plugin should work with older esm-compatible tsconfig options. For example, my current config:

{
  "compilerOptions": {
    "module": "es2022",
    "moduleResolution": "node",
  }
}
@aleclarson
Copy link
Owner

Sorry about that! Fixed in v5.0.1

@mikestopcontinues
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants