Search code examples
node.jsrestdiscord.jsbots

(node:2713) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time in @discordjs/rest


I'm using @discord.js/rest for slash command handling by discord.js v13.6.0 BOT on node.js v16.10.0

Path: node_modules/undici/lib/fetch/response.js

ERROR at Console:

(node:2713) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time

here is response.js : response.js

I've removed all variables including ReadableStream which requires ('stream/web')

here the edited response.js : reponse_edited.js

IS THAT OKAY TO EDIT LIKE THIS?


Solution

  • It is generally not recommended to directly modify code within node_modules or any other external libraries. This is because any changes you make could cause unforeseen issues with the library and could potentially break your code.

    In your case, the error message is just a warning about an experimental feature. It shouldn't cause any issues with your code or affect the functionality of your Discord bot.

    Instead of modifying the library code, you can try suppressing the warning message by adding the following line of code at the top of your file:

    process.env.NODE_NO_WARNINGS = 'stream/web';

    This should suppress the experimental warning and prevent it from being printed to the console. However, keep in mind that this may not be a permanent solution as the warning message may be removed or changed in future versions of Node.js.