achievements-app/psn-api

Request to add "types" to package.json "exports" to fix "Not declaration file" related error messages

Closed this issue · 3 comments

When importing functions and types I get the following warning message on my imports.

Could not find a declaration file for module 'psn-api'. '/node_modules/psn-api/dist/psn-api.esm.js' implicitly has an 'any' type.   There are types at '/node_modules/psn-api/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'psn-api' library may need to update its package.json or typings.

You can easily fix this by adding "types": "./dist/index.d.ts" to the exports entry in package.json.

Thanks.

@wescopeland any workaround for this? before fix getting shipped?

ok, if you encounter this problem. Workaround for solving this issue is modifying your tsconfig.json

extend your tsconfig.json with this

"compilerOptions": { "moduleResolution": "node" },

Happy to accept a PR on this, I'm not sure how to verify whether or not this is working.