Closed unclamped closed 1 year ago
turns out it was because there was a .default
added in the end, when it should've been .plugin
. I have no ideas as to why that happened, apologies
wait actually, no, why would npm work with it but not pnpm, I'm rite
Gonna check this sometime
In my testing I was able to install & use mineflayer-auto-eat just fine with pnpm. Are you sure its not an error in the code you wrote?
Will close this issue otherwise
After doing some testing locally in my fork of 2bored2wait, and after trying to migrate from npm to pnpm, I found that this plugin would no longer be loaded by Mineflayer, and instead cause a crash. The crash originates on line 16 of Mineflayer's plugin loader, where it checks if the argument it has been passed (what should be the const of the required plugin) is a function or not: If not, it fails. In the code, the plugin is imported with
const autoeat = require("mineflayer-auto-eat").default;
. Then, it tries to load that plugin and others, which is when it then calls the loadPlugin function that I talked about previously. (in the screenshot it also shows a different plugin being loaded. I confirmed that it was auto-eat the one generating the issue, as shown in the following screenshot) I tried looking at this plugin's code to see what the issue could be, but A- I am way too tired for today, and B- I didn't find anything obvious.