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(core): add @types/node-fetch to runtime dependency #11560

Conversation

AllanZhengYP
Copy link
Contributor

The isomorphic-unfetch dependency re-exports artifacts from node-fetch package in its .d.ts file. However, the node-fetch package does not contain any .d.ts file with itself. So the exported artifacts can not be resolved by tsc. It's not an issue before possibly because the client-s3 contains transitive runtime dependency of @types/node-fetch. Since it's removed now, we are encountered with this error.

Adding the dependency to runtime instead of dev or peer deps to prevent brokage for customers

Issue #, if available

Description of how you validated changes

Local test

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The isomorphic-unfetch dependency re-exports artifacts from node-fetch
package in its .d.ts file. However, the node-fetch package does not
contain any .d.ts file with itself. So the exported artifacts can not be
resolved by tsc. It's not an issue before possibly because the client-s3
contains transitive runtime dependency of @types/node-fetch. Since
it's removed now, we are encountered with this error.

Adding the dependency to runtime instead of dev or peer deps to prevent
brokage for customers
@AllanZhengYP AllanZhengYP requested review from a team as code owners June 29, 2023 20:21
@codecov-commenter
Copy link

Codecov Report

Merging #11560 (cda1fa8) into v5/custom-clients (4085319) will not change coverage.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@                Coverage Diff                 @@
##           v5/custom-clients   #11560   +/-   ##
==================================================
  Coverage              83.65%   83.65%           
==================================================
  Files                    336      336           
  Lines                  21491    21491           
  Branches                4586     4586           
==================================================
  Hits                   17978    17978           
  Misses                  3226     3226           
  Partials                 287      287           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@AllanZhengYP AllanZhengYP merged commit 0dab406 into aws-amplify:v5/custom-clients Jun 29, 2023
5 checks passed
@AllanZhengYP AllanZhengYP deleted the fix/missing-node-fetch-type branch June 29, 2023 21:01
kvramyasri7 pushed a commit to kvramyasri7/amplify-js that referenced this pull request Jul 7, 2023
…1560)

The isomorphic-unfetch dependency re-exports artifacts from node-fetch
package in its .d.ts file. However, the node-fetch package does not
contain any .d.ts file with itself. So the exported artifacts can not be
resolved by tsc. It's not an issue before possibly because the client-s3
contains transitive runtime dependency of @types/node-fetch. Since
it's removed now, we are encountered with this error.

Adding the dependency to runtime instead of dev or peer deps to prevent
brokage for customers
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

Successfully merging this pull request may close these issues.

None yet

4 participants