Closed ZachHaber closed 8 months ago
I havenβt looked at your proposed solution, but I can confirm the issue.
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.
import clone from '@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.
Fix published in v11.0.4
.
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.