Description
@wordpress/preferences package ships type definitions under build-types folder, but hese are not exposed in package.json "exports", which causes TypeScript resolution errors such
There are types at node_modules/@wordpress/preferences/build-types/index.d.ts,
but this result could not be resolved when respecting package.json "exports".
The @wordpress/preferences library may need to update its package.json or typings.
Because the package defines an "exports" field, Node and TypeScript treat any unlisted paths as private and the types folder is not exported.
|
"exports": { |
|
".": { |
|
"import": "./build-module/index.js", |
|
"require": "./build/index.js" |
|
}, |
|
"./package.json": "./package.json", |
|
"./build-style/": "./build-style/" |
|
}, |
Additional Notes
This issue affects projects using strict "moduleResolution": "node16" / "bundler" (Next.js, Vite, modern TS).
Description
@wordpress/preferencespackage ships type definitions underbuild-typesfolder, but hese are not exposed in package.json "exports", which causes TypeScript resolution errors suchBecause the package defines an "exports" field, Node and TypeScript treat any unlisted paths as private and the types folder is not exported.
gutenberg/packages/preferences/package.json
Lines 29 to 36 in 34d7cc9
Additional Notes
This issue affects projects using strict "moduleResolution": "node16" / "bundler" (Next.js, Vite, modern TS).