hapijs / hapijs/hoek

TypeScript errors on import

Open
#394 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
481
Forks
179
PR merge metrics
No merged PRs in 30d

Description

### 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:

```ts
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.