Context
I can't use the library.
Current Behavior
Using "moduleResolution": "Bundler", in my tsconfig.json, I get the following error:
import {} from '@stoplight/json-schema-viewer'
Could not find a declaration file for module '@stoplight/json-schema-viewer'. 'c:/.../project/node_modules/@stoplight/json-schema-viewer/index.mjs' implicitly has an 'any' type.
There are types at 'c:/.../project/node_modules/@stoplight/json-schema-viewer/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@stoplight/json-schema-viewer' library may need to update its package.json or typings.
Expected Behavior
I can import the library.
Possible Workaround/Solution
This seems to be related to: microsoft/TypeScript#52363
In another project, I have the following in my package.json. Something like this should be sufficient.
{
"name": "package",
"type": "module",
"...": "...",
"exports": {
".": {
"types": "./src/index.ts",
"default": "./dist/index.js"
},
"./example": {
"types": "./src/example.ts",
"default": "./dist/example.js"
}
}
}
Steps to Reproduce
-
tsconfig.json with the following:
{
"compilerOptions": {
"moduleResolution": "Bundler",
},
}
-
Import the dependency:
import {} from '@stoplight/json-schema-viewer'
Environment
TypeScript 5.5.3
Context
I can't use the library.
Current Behavior
Using
"moduleResolution": "Bundler",in my tsconfig.json, I get the following error:Expected Behavior
I can import the library.
Possible Workaround/Solution
This seems to be related to: microsoft/TypeScript#52363
In another project, I have the following in my
package.json. Something like this should be sufficient.{ "name": "package", "type": "module", "...": "...", "exports": { ".": { "types": "./src/index.ts", "default": "./dist/index.js" }, "./example": { "types": "./src/example.ts", "default": "./dist/example.js" } } }Steps to Reproduce
tsconfig.json with the following:
{ "compilerOptions": { "moduleResolution": "Bundler", }, }Import the dependency:
Environment
TypeScript 5.5.3