Skip to content

2.0.7 has broken TS types #386

@elektronik2k5

Description

@elektronik2k5

Bug

I just upgraded from 2.0.6 to 2.0.7 and the TS types are broken:

error TS7016: Could not find a declaration file for module 'react-native-permissions'. '/home/[redacted]/node_modules/react-native-permissions/lib/commonjs/index.js' implicitly has an 'any' type.
  Try `npm install @types/react-native-permissions` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-native-permissions';`

Looking at the installed package.json:

"types": "lib/typescript/src/index.d.ts",

While the directory tree looks like so:

tree ./node_modules/react-native-permissions/lib/typescript 
./node_modules/react-native-permissions/lib/typescript
├── constants.d.ts
├── index.d.ts
└── types.d.ts

As you can see, the problem is in the package.json value of the "types" property.
0276fc8#diff-b9cfc7f2cdf78a7f4b91a753d10865a2L19

Environment info

Latest TS: 3.7.3

Library version: 2.0.7

Steps To Reproduce

  1. Install v2.0.7
  2. Try to import anything in TS
  3. Error as seen above
  4. ???
  5. PROFIT!!!

Describe what you expected to happen:

  1. It should work

Reproducible sample code

Once I reverted to 2.0.6 everything started working again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions