-
Notifications
You must be signed in to change notification settings - Fork 224
Open
algolia/api-clients-automation
#5740Labels
Description
Description
The wildcard exports patterns in package.json cause Metro bundler (used by Expo/React Native) to produce warnings about non-existent files.
Warning Message
WARN The package /Users/.../node_modules/algoliasearch contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).
Reason: The resolution for "/Users/.../node_modules/algoliasearch/dist/lite/builds/browser.js" defined in "exports" is /Users/.../node_modules/algoliasearch/dist/lite/builds/browser.js.js, however this file does not exist. Falling back to file-based resolution.
Root Cause
The following wildcard exports patterns in package.json are causing the issue:
"exports": {
...
"./dist/*": "./dist/*.js",
"./dist/lite/builds/*": "./dist/lite/builds/*.js"
}When Metro resolves ./dist/lite/builds/browser.js, the wildcard pattern ./dist/lite/builds/* captures browser.js as the * portion, and then substitutes it into ./dist/lite/builds/*.js, resulting in ./dist/lite/builds/browser.js.js — which doesn't exist.
Environment
- algoliasearch version: 5.46.0
- Bundler: Metro (via Expo)
- Platform: React Native / Expo
Client
Search
Version
5.46.0