Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript errors on import #394

Open
joshkel opened this issue May 22, 2024 · 0 comments · May be fixed by #393
Open

TypeScript errors on import #394

joshkel opened this issue May 22, 2024 · 0 comments · May be fixed by #393
Labels
bug Bug or defect

Comments

@joshkel
Copy link

joshkel commented May 22, 2024

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.

@joshkel joshkel added the bug Bug or defect label May 22, 2024
@joshkel joshkel linked a pull request May 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant