Skip to content
Discussion options

You must be logged in to vote

Hello!

That is a very common and frustrating issue when mixing VSCode's TypeScript heuristics with modern bundlers like Vite, especially when packages have internal /dist/ paths. Your diagnosis is correct: you want the imports without /dist/.

The problem is that your VSCode/TypeScript configuration is likely using an outdated module resolution setting that doesn't accurately mimic how Vite resolves modules.

The Recommended Solution: Update Module Resolution

The most elegant and professional solution is to update your tsconfig.json to use a modern module resolution strategy that aligns perfectly with Vite and ESM environments.

Change your moduleResolution setting from "node" to "bundler":

/…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@FunctionDJ
Comment options

Answer selected by FunctionDJ
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants