Fix missing 'exports.types' field of package.json#2
Open
dalboris wants to merge 1 commit intoros2jsguy:mainfrom
Open
Fix missing 'exports.types' field of package.json#2dalboris wants to merge 1 commit intoros2jsguy:mainfrom
dalboris wants to merge 1 commit intoros2jsguy:mainfrom
Conversation
Author
|
Also see the following page, checking whether there's indeed something to be changed in threejs-math package.json: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

In a recent project set up with Vite+Typescript, I installed threejs-math (
npm install threejs-math) and imported some types:But I got the following Typescript errors in my IDE (Sublime Text 4 with LSP-Typescript plugin):
At first I thought it was probably a configuration problem of my project, my installation, or my IDE, but I couldn't fix it that way.
So following the suggestion of the error message, I looked online and found many projects having the same problem, which seems caused by the addition of new module resolution methods in recent versions of Typescript, see the following threads:
typescondition to thepackage.json#exportsgxmari007/vite-plugin-eslint#60The solution seems indeed to add the following to
threejs-math/package.json:I tested this change and indeed it makes the error message go away in my case, and all types are now properly imported in my project.