fix(exports): corrected broken import path to avoid fallback resolution #16
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.
This PR updates the exports field in
package.jsonto resolve a broken import path that currently triggers fallback resolution in Node environments.Problem:
Replaced broken "import": "./index.js" with correct "import": "./esm.mjs" to match published files and avoid fallback resolution. This causes Node to fall back to file-based resolution, resulting in warnings like:
Code:
The resolution for "use-latest-callback" defined in "exports" is
./esm.mjs, however this file does not exist. Falling back to file-based resolution.This fallback behavior is fragile and breaks compatibility with bundlers like Metro (React Native) and Vite, which rely on strict exports resolution.
Fix
Replaced the broken "import" path with a valid conditional exports block in
package.json:This ensures:
Tested With: