-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add conditional loading for cross-fetch/polyfill - favour native fetch #1488
Conversation
Hey @icyJoseph, you are right. Until v16 is end of life, we should keep the possibility to use the polyfill but since v18 is the latest node version, users shouldn't have to download the polyfill if they are in v18 and above. I'm reviewing your PR soon :) I was on holiday. Thanks for your contribution btw 🙏 |
Hey @icyJoseph, I was trying things out. I just realised that there is one file that I created that is not being ran by the CI (nor is it present in the package.json). Could you try the following:
It raises the following error:
If it's oke for you, could you update this line in the package.json:
with
|
Right, so that's why the I'll see if there's a better place to conditionally load the polyfill. |
Thanks 🙏 |
I switch to requiring conditionally, and now I see this error: class_1 [MeiliSearchApiError]: Attribute `id` is not filterable. Available filterable attributes are: `genres director`.
1:3 id >= 1 When running: yarn build
cd tests/env/node
node getting_started.js And then it fails with a 400 error |
There is apparently an error in the getting_started.js file. Could you change line await index.updateFilterableAttributes([
'director',
'genres',
'id'
]) I also realise that "test:env:nodejs": "yarn build && node tests/env/node/index.js && node tests/env/node/getting_started.js", |
Alright, I think it is looking good so far 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✨✨✨✨
Thanks a lot
bors merge |
Build succeeded:
|
1499: Remove conditionnal loading for fetch polyfill r=bidoubiwa a=bidoubiwa Fixes: #1488 Co-authored-by: Charlotte Vermandel <[email protected]>
Pull Request
Related issue
Fixes #1487
What does this PR do?
Load
cross-fetch/polyfill
only iffetch
isundefined
.PR checklist
Please check if your PR fulfills the following requirements: