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

[Typescript-Issue] - Cannot find name 'HeadersInit'. #693

Closed
idrissakhi opened this issue Nov 6, 2023 · 6 comments · Fixed by #694
Closed

[Typescript-Issue] - Cannot find name 'HeadersInit'. #693

idrissakhi opened this issue Nov 6, 2023 · 6 comments · Fixed by #694
Labels
bug Something isn't working released

Comments

@idrissakhi
Copy link

Environment

info Fetching system and libraries information...
System:
OS: macOS 14.0
CPU: (10) x64 Apple M1 Pro
Memory: 21.66 MB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 19.5.0
path: /usr/local/bin/node
Yarn:
version: 1.22.19
path: /usr/local/bin/yarn
npm:
version: 9.3.1
path: /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.13.0
path: /Users/sakhiidris/.rvm/gems/ruby-3.2.2/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.0
- iOS 17.0
- macOS 14.0
- tvOS 17.0
- watchOS 10.0
Android SDK: Not Found
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10811636
Xcode:
version: 15.0.1/15A507
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.11
path: /usr/bin/javac
Ruby:
version: 3.2.2
path: /Users/sakhiidris/.rvm/rubies/ruby-3.2.2/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.6
wanted: 0.72.6
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

Platforms

both

Versions

  • Android: All
  • iOS: All
  • react-native-netinfo: 11.0.0
  • react-native: 0.72.6
  • react: 18.2.0

Description

The types.ts file contains an unknown type 'HeadersInit' line 120.

Reproducible Demo

@idrissakhi idrissakhi added the bug Something isn't working label Nov 6, 2023
@idrissakhi
Copy link
Author

the issue was brought with this PR => https://github.com/react-native-netinfo/react-native-netinfo/pull/673/files

@mikehardy
Copy link
Contributor

@idrissakhi interesting - I asked the original author what they thought about a generic string/string typing: https://github.com/react-native-netinfo/react-native-netinfo/pull/673/files#r1384043876

What happens when you patch the file to change HeadersInit to { [index: string]: string} as proposed in that comment? Does it work for you?

Any PR like that that works would be fine by me

@idrissakhi
Copy link
Author

@mikehardy i wanted to create a PR but i do not have permissions. and i confirmm changing to reachabilityHeaders?: Record<string, string>; will work

@mikehardy
Copy link
Contributor

Anyone has permission to make a PR on a fork? Thanks for confirmation of a concrete working type though that helps. Try a fork and PR to see if it's possible, should be

@mikehardy
Copy link
Contributor

@idrissakhi just merged a PR with the change you proposed, it should go out in just a minute as version 11.0.1 please let me know how that works for you. Thanks!

@matt-oakes
Copy link
Collaborator

🎉 This issue has been resolved in version 11.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants