-
Notifications
You must be signed in to change notification settings - Fork 2
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
Can't update node-fetch #33
Comments
You can no longer use require to load node-fetch as it's now ESM only const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); |
Then it will give this error in Javascript but typescript build doesnt fail.
|
I wrote this earlier in node-fetch Discord:
Havent tested yet those possible solutions |
eximiabots-radiox/src/client/events/ready.js Lines 2 to 3 in ac323a5
eximiabots-radiox/src/client/commands/maintenance.js Lines 2 to 3 in ac323a5
After npm build it's stays same. @jimmywarting This is temporary fix to my issue |
Is there a way to hide experimental feature warning @jimmywarting
|
It is possible to run node with --no-warning flag |
Is this safe way to import module if it works, can I push this to production bot when its time to release version 0.3.10. |
Grate idea about constructing a new function that don't get transformed Will start recommend it in node-fetch also |
Nice @jimmywarting 😄 |
I just looked for solution in microsoft/TypeScript#43329 and saw that there is example _importDynamic (microsoft/TypeScript#43329 (comment)) and then decided try it in combined with earlier #33 (comment) |
Biggest headache of the day. For anyone who does not have time to figure out how to get ESM to work with typescript and ts-node or whatever and just wants a browser-like fetch function fast, now, downgrade to node-fetch 2.x.x:
and just import as
and get on with your life. |
No description provided.
The text was updated successfully, but these errors were encountered: