hapijs / hoek

Node utilities shared among the extended hapi universe
Other
481 stars 171 forks source link

TypeScript errors on import #394

Open joshkel opened 3 months ago

joshkel commented 3 months ago

Runtime

Node.js

Runtime version

18.20.2

Module version

11.0.2

Last module version without issue

No response

Used with

Hapi

Any other relevant information

No response

What are you trying to achieve or the steps to reproduce?

I'm authoring a Hapi plugin and trying to import from the Hoek project:

import * as Hoek from '@hapi/hoek';

My tsconfig.json is configured for "moduleResolution": "node16", "module": "node16".

What was the result you got?

error TS7016: Could not find a declaration file for module '@hapi/hoek'. 'node_modules/@hapi/hoek/lib/index.mjs' implicitly has an 'any' type.
  There are types at 'node_modules/@hapi/hoek/lib/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@hapi/hoek' library may need to update its package.json or typings.

11 import * as Hoek from '@hapi/hoek';
                         ~~~~~~~~~~~~

What result did you expect?

Successful compilation.