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

React declaration not found in Fastify (Node.js) app #406

Open
shidoxo opened this issue Aug 3, 2024 · 1 comment
Open

React declaration not found in Fastify (Node.js) app #406

shidoxo opened this issue Aug 3, 2024 · 1 comment

Comments

@shidoxo
Copy link

shidoxo commented Aug 3, 2024

node_modules/resend/dist/index.d.ts:1:24 - error TS7016: Could not find a declaration file for module 'react'. 'C:/Users/<redacted>/<redacted>/<redacted>/<redacted>/<redacted>/node_modules/react/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/react` if it exists or add a new declaration (.d.ts) file containing `declare module 'react';`

1 import * as React from 'react';

Found 1 error in node_modules/resend/dist/index.d.ts:1

Why do i need React at all in my NodeJS server? If there's React, why is declaration file not provided?

@mcfarljw
Copy link

mcfarljw commented Sep 21, 2024

I'm seeing the same same issue. The reason is because there is a react dependency so for those not using react it's causing typing errors.

https://github.com/resend/resend-node/blob/c69c13f582314011281ba2b667a9645978f43839/package.json#L45C5-L45C36 this should not be a required dependency as many aren't using react.

Running npm i --save-dev @types/react fixes the issue but we shouldn't have to install react typings if we're not using react.

jordan-dinwiddy added a commit to jordan-dinwiddy/fixitpdf that referenced this issue Nov 27, 2024
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

No branches or pull requests

2 participants