You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I used patch-package to patch @hapi/hoek@11.0.2 for the project I'm working on.
I'm using typescript with the config "module": "NodeNext", which makes typescript very particular about the exports and types. Due to this, when I updated @hapi/hoek to the latest version (11.0.2) from version ^10, I started getting an error that I was missing the types for @hapi/hoek despite the types being in the package. This error is fixed by adding the index.d.ts type file to the main exports types field.
Then in the project you have to pull in Hoek as either individual named exports or using import * as Hoek from '@hapi/hoek'
If anyone else is having this issue in the meantime, instead of using patch-package, you can also import the sub-modules directly (which does use commonjs, but the interop doesn't have an issue here)
e.g.
importclonefrom'@hapi/hoek/clone'
It's a little more annoying and doesn't have the auto-import functionality that the main import does, but it won't cause type issues.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
@hapi/hoek@11.0.2
for the project I'm working on.I'm using typescript with the config
"module": "NodeNext"
, which makes typescript very particular about the exports and types. Due to this, when I updated @hapi/hoek to the latest version (11.0.2) from version ^10, I started getting an error that I was missing the types for @hapi/hoek despite the types being in the package. This error is fixed by adding theindex.d.ts
type file to the main exports types field.Then in the project you have to pull in Hoek as either individual named exports or using
import * as Hoek from '@hapi/hoek'
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: