🐛 yaml.load is safe by default! Please stop using yaml.safeLoad!
See original GitHub issueHello there,
So I recently found an issue with the NPM package. Whenever I try to reinstall the module it goes all fine. When I run my code for the second time I keep getting an error from the node_modules\discord-giveaways\src\Constants.js
file.
The error has to do with the module js-yaml
. For some reason I can’t find the code that’s giving me the errors in the GitHub repo, but I can find it in the installed module. The following code is giving me the error shown in attachments:
function loadFile(file) { return (myFile = yaml.safeLoad(fs.readFileSync(`${file}`, 'utf8'))) `}
js-yaml
Doesn’t want to load the file because yaml.safeLoad
is not supported anymore. The following code is a fix for the issue just I don’t know where to push it to. This fixes the issue and doesn’t remove any safety loading as yaml.load
is safe by default
function loadFile(file) { return (myFile = yaml.load(fs.readFileSync(`${file}`, 'utf8'))) `}
I hope you can do anything with this issue/bug report
Attachments: Error Logs.txt Error Logs Trace-Warnings.txt
Issue Analytics
- State:
- Created 2 years ago
- Comments:12
Top GitHub Comments
When I use the following command it downloads the normal file for 10 seconds and then the weird command shows up again:
git pull && npm install Androz2091/discord-giveaways#develop && node index.js
if I keep that as the startup command it works, but it almost hits the CPU limit for my bot (50% of one core) when i start it up.
I’ll try to find the origin of the issue and try to fix it as this isn’t a bug with discord-giveaways
I have, it doesn’t download it on that (it was downloaded outside of docker)