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

Types are missing in 1.5.0 #45

Open
jeanremy opened this issue Jul 21, 2023 · 2 comments
Open

Types are missing in 1.5.0 #45

jeanremy opened this issue Jul 21, 2023 · 2 comments

Comments

@jeanremy
Copy link

Hi,

Using the 1.5.0 version of the package, my editor can't find the type declaration file. According to the package.json, it should be at the root of the project, but no file is here. Instead, a declaration file is created inside the lib/typescript directory (with just any as type).

I'd be glad to help if you can give me some information about the build system.

Version 1.4.2 is fine, by the way (see it in npm)

@danger9224
Copy link

Yep, I also received this error, which prevents me from building the app, which is quite annoying:

Could not find a declaration file for module 'react-native-compass-heading'. '.../node_modules/react-native-compass-heading/lib/commonjs/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/react-native-compass-heading` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-native-compass-heading';`ts(7016)

@pranshuchittora
Copy link

I am also facing the same issue. As a temporary I patched the package. Using patch-pacakge

patches/react-native-compass-heading+1.5.0.patch

diff --git a/node_modules/react-native-compass-heading/package.json b/node_modules/react-native-compass-heading/package.json
index 1093f71..20e8947 100644
--- a/node_modules/react-native-compass-heading/package.json
+++ b/node_modules/react-native-compass-heading/package.json
@@ -4,7 +4,7 @@
   "description": "Listener to device's compass information.",
   "main": "lib/commonjs/index",
   "module": "lib/module/index",
-  "types": "index.d.ts",
+  "types": "lib/typescript/index.d.ts",
   "react-native": "src/index",
   "source": "src/index",
   "files": [

In order to create a patch run either copy the file or run this npx patch-package react-native-compass-heading --exclude 'nothing'

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

3 participants