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

[fix] react-uswds no longer ships a .d.ts file, cannot be used with TypeScript any more #2053

Closed
lpsinger opened this issue Apr 25, 2022 · 4 comments · Fixed by #2076
Closed
Labels
type: bug Something isn't working like it's supposed to

Comments

@lpsinger
Copy link
Contributor

ReactUSWDS Version & USWDS Version:

@trussworks/[email protected], [email protected]

Describe the bug

react-uswds 3.0.0 no longer ships a .d.ts file, so it cannot be used in strict TypeScript projects.

To Reproduce

See https://github.com/tachgsfc/gcn.nasa.gov/runs/6163692157?check_suite_focus=true. Error message:

Error: app/components/CopyableCode.tsx(9,41): error TS7016: Could not find a declaration file for module '@trussworks/react-uswds'. '/home/runner/work/gcn.nasa.gov/gcn.nasa.gov/node_modules/@trussworks/react-uswds/lib/index.js' implicitly has an 'any' type.
[5](https://github.com/tachgsfc/gcn.nasa.gov/runs/6163692157?check_suite_focus=true#step:6:5)
  Try `npm i --save-dev @types/trussworks__react-uswds` if it exists or add a new declaration (.d.ts) file containing `declare module '@trussworks/react-uswds';`
[6](https://github.com/tachgsfc/gcn.nasa.gov/runs/6163692157?check_suite_focus=true#step:6:6)

Expected behavior

react-uswds should ship an index.d.ts file.

Screenshots

Additional context

Device and Browser Information (please complete the following information if describing a UI bug):

@lpsinger lpsinger added the type: bug Something isn't working like it's supposed to label Apr 25, 2022
@Joshua-Flores
Copy link

Experiencing the same issue

@lpsinger
Copy link
Contributor Author

lpsinger commented May 9, 2022

Any workarounds?

@brandonlenz
Copy link
Contributor

I'm looking in to this at the moment. Will update as a fixed version becomes available.

@lpsinger For now I would recommend staying on the 2.8.0 release.

@brandonlenz
Copy link
Contributor

This will be resolved in the next release. Likely 3.0.2

brandonlenz added a commit that referenced this issue May 17, 2022
### [3.0.2](3.0.1...3.0.2) (2022-05-13)


### Bug Fixes

* Fixes an issue where Type definitions were not properly packaged ([#2053](#2053)) ([febcd65](febcd65))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working like it's supposed to
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants