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

include types export for ts4.7 nodenext resolution #406

Merged
merged 2 commits into from
May 2, 2022
Merged

include types export for ts4.7 nodenext resolution #406

merged 2 commits into from
May 2, 2022

Conversation

lizthegrey
Copy link
Contributor

@lizthegrey lizthegrey commented May 1, 2022

See microsoft/TypeScript#47792 (comment)

otherwise, building with nodenext resolution results in:

src/data-source/accessToken/jwt.ts:1:22 - error TS7016: Could not find a declaration file for module 'jose'. '/home/lizf/.yarn/berry/cache/jose-npm-4.8.0-c82ffaaa1e-9.zip/node_modules/jose/dist/node/esm/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/jose` if it exists or add a new declaration (.d.ts) file containing `declare module 'jose';`

1 import { jose } from "jose";
                       ~~~~~~

@panva
Copy link
Owner

panva commented May 1, 2022

no fallbacks huh...

@panva
Copy link
Owner

panva commented May 1, 2022

Any chance this will break any currently working code?

@lizthegrey
Copy link
Contributor Author

Any chance this will break any currently working code?

I have no idea! I believe this is only used by the new resolver, but defer to the wisdom of folks on the TypeScript project.

@panva
Copy link
Owner

panva commented May 1, 2022

Hope they can do something about this until 4.7 goes gold, ie acknowledging that the "." export is effectively the root export and if "types" is already present that is what should be used. Or at least come out and say this won't break anyone.

@lizthegrey
Copy link
Contributor Author

have verified with yarn patch-commit and importing this patchset that it works.

@panva panva merged commit 5a6d8f0 into panva:main May 2, 2022
@lizthegrey lizthegrey deleted the patch-1 branch May 2, 2022 14:46
@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants