-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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' #9508
Comments
Can you provide a code sample? |
Not easily, no. but when I look in the compiled code given we see Which does not go through the functions at the top "__toESM" and "__toCommonJS" unlike those for example:
It uses import instead of require Locally it works fine, it's just when I deploy it and package it with vercel/pkg that it stops functioning, and I don't know how to reproduce it without it |
it uses dynamic import to load only if needed.
maybe |
|
I made sure to include the whole node_modules as asset to test that out. The problem still occurs. Im pretty sure the package is bundled |
Sorry, but our bundle is correct and the package correctly works with both cjs and mjs under regular environments, so this sounds like an issue with vercel pkg or the environment that you're deploying to. |
This problem occurs with nexe too, so it's not just vercel/pkg |
Which package is this bug report for?
discord.js/rest
Issue description
When making a bot in CommonJS, dynamic imports of esm modules fails.
Will anything be done for this?
Thanks
Code sample
No response
Versions
Discord 14.9.0
Node 18.16.0
Typescript 5.0.3
Issue priority
Low (slightly annoying)
Which partials do you have configured?
Not applicable
Which gateway intents are you subscribing to?
Not applicable
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered: