./*.d.ts
required in exports
to avoid Cannot be named without a reference to... not portable...
#60913
Labels
Needs More Info
The issue still hasn't been fully clarified
π Search Terms
The inferred type of '...' cannot be named without a reference to... This is likely not portable. A type annotation is necessary.
π Version & Regression Information
Between 5.3 to 5.7 (latest)
β― Playground Link
No response
π» Code
TSconfig of importing project
Package.json of project BEING IMPORTED
π Actual behavior
If you do not include
"./lib/*.d.ts": "./lib/*.d.ts"
in the package.json of the imported project, you will receive the...likely not portable...
error.However, in none of the documentations and searches I've seen was this written as a requirement. As a result, I assume it's a bug.
The problem with the above solution is that it exposes the
.d.ts
files, which causes intellisense import suggestions to suggest two imports (one from the proper path, and one from the .d.ts path).Note:
main:./lib/index.js
instead ofexports:...
also removes the error.π Expected behavior
Should not need to explicitly export all types
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: