-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
📝 Docs: Explain pnpm and declaration emit awkwardness #1244
Comments
Yeah 😬 as you said, this is really a TypeScript limitation with pnpm-style linking and I don't have any great workarounds myself. I think the right resolution would be a docs issue. For visibility to any readers: what's happening here is TypeScript thinks it can't reasonably generate a
In other words, TypeScript thinks |
@all-contributors please add @danvk for ideas.
|
I've put up a pull request to add @danvk! 🎉 I couldn't determine any contributions to add, did you specify any contributions? |
Adds @danvk as a contributor for ideas. This was requested by JoshuaKGoldberg [in this comment](#1244 (comment)) --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Bug Report Checklist
main
branch of the repository.Expected
I expected to be able to define a helper module that imported
vitest
without error:Actual
I got an extremely cryptic error:
Additional Info
Here's an example of this error happening:
The gist seems to be that
declaration: true
andpnpm
don't work very well together. There are many, many issues about this on the TypeScript issue tracker. The original is microsoft/TypeScript#29808.This seems to be the canonical comment discussing workarounds: microsoft/TypeScript#47663 (comment)
In my case I just turned off
.d.ts
emit, though this isn't ideal.Dropping pnpm seems a little drastic, but this isn't great and
create-typescript-app
pushes you towards this error with its defaults. At the very least there could be something about this in the FAQ. A link to that comment in particular would have saved me some time today.The text was updated successfully, but these errors were encountered: