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
Error: Cannot find package 'file-type' #1046
Comments
any help? |
I hit this problem too. v13 is fine but v14 crashes with this error when trying to send a message with a file attachment. |
If you're saying it works in v13, but not in v14, then perhaps thats the thing I didn't know which would make them actually investigate the bug now that v14 is known to be the issue here. I would assume it would be a problem with how they build their library over how nexe handled the bundling of common js files. |
I investigated today and it seems the issue is that discord.js v14 is using ESM modules. Both nexe and vercel/pkg don't support ESM... So your options are to use v13 or ... be reckless and irresponsible like me and hack the @discordjs\rest\dist\index.js file so it doesn't import the file-type package. |
What happened:
I get this error when I use some features in my Discord bot, I've spoken to staff from the Framework of Discord.js and they believe this has to do with incorrect importing.
What you expected to happen:
To not show this error and import properly.
How to reproduce it (as minimally and precisely as possible):
setup a discord bot with discord.js V14 and create an attachment file.
Anything else we need to know?:
no
Environment:
The text was updated successfully, but these errors were encountered: