feathersjs-ecosystem / feathers-localstorage

A client side service based on feathers-memory that persists to LocalStorage
MIT License
38 stars 15 forks source link

TypeScript definitions not referenced in package.json #105

Closed C0Nd3Mnd closed 4 years ago

C0Nd3Mnd commented 4 years ago

Steps to reproduce

  1. Install the package in a TypeScript project (npm i feathers-localstorage).
  2. import the package somewhere (import localstorage from 'feathers-localstorage').

(First please check that this issue is not already solved as described here)

The definitions exist in the types folder, but they aren't referenced in the package.json. This bug is fixed by adding "types": "types/" to the package.json file.

Expected behavior

No error should be thrown by the TypeScript compiler and the definitions should be shown correctly.

Actual behavior

The following error is thrown by the TypeScript compiler:

Could not find a declaration file for module 'feathers-localstorage'. '[...]/node_modules/feathers-localstorage/lib/index.js' implicitly has an 'any' type. Try npm install @types/feathers-localstorage if it exists or add a new declaration (.d.ts) file containing declare module 'feathers-localstorage';

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working): 5.1.0

NodeJS version: 12.6.1

Operating System: Windows 10 1909 64-Bit

Browser Version: Microsoft Edge 80.0.361.69

React Native Version: -

Module Loader: -