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

@prefresh/vite types can’t be resolved when project uses modern TypeScript resolution modes #518

Closed
lemonmade opened this issue Oct 31, 2023 · 0 comments · Fixed by #519

Comments

@lemonmade
Copy link
Contributor

When a developer uses a TypeScript project configured to respect export conditions, @prefresh/vite can’t be resolved by TypeScript with the following error:

> tsc --pretty

index.ts:1:22 - error TS7016: Could not find a declaration file for module '@prefresh/vite'. '/Users/lemon/dev/temporary/23-10-30-prefresh-vite-type-fix/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@prefresh/vite/src/index.js' implicitly has an 'any' type.
  There are types at '/Users/lemon/dev/temporary/23-10-30-prefresh-vite-type-fix/node_modules/@prefresh/vite/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@prefresh/vite' library may need to update its package.json or typings.

1 import prefresh from '@prefresh/vite';
                       ~~~~~~~~~~~~~~~~


Found 1 error in index.ts:1

Here’s a repo that reproduces the problem: https://github.com/lemonmade/23-10-30-prefresh-vite-type-fix

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

Successfully merging a pull request may close this issue.

1 participant