No types for @discordjs/core/http-only
so
@discordjs/core/http-only
isn't giving any type declarations for some reason. easy workaround is to just import the types manually and use them when needed (as shown in the code snippet), but i just wanted to check if this was a known issue21 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by staffpackage version: 1.0.1
node version: 19.3.0
doesn't look like typescript can find any package at all, code works fine though
code works fine thoughif there are no issues when compiling, it sounds more like an ide issue consider restarting your ts server
nope, same error after restarting ts server
don't know much about
exports
in package.json files but maybe thats the issue? importing the package normally works fine because of main
, module
, and typings
at the top, but nothing in exports
is workingi can always add a ts-ignore to get rid of the type error and just import them manually, but it's not ideal
again, if there are no issues when compiling, it sounds more like an ide issue
restarting your ts server was just a suggestion that could solve it
well yes, but it could be an issue with the package. i doubt it's a vscode issue anyway
works fine compiling (via nextjs) without the types too
should i make an issue on github?
then I'm especially inclined to believe the issue is something local, even if it's not your ide
it might be, i just don't think there's anything else that could be effecting it.
i think i saw something like this happening when i was searching if it was a known issue, let me find it again
@duck found it
it can't be local
I don't see why that means it can't be local
if it's happening on 2 different devices, possibly on 2 different ide versions too, i doubt it
they do seem to be using NextAuth though, i'm in a nextjs project too, so it may be that
but again, doubt
https://github.com/discordjs/discord.js/issues/9695#issuecomment-1629680669
found another
same error
and here
should i make an issue now?
well then to address your question about the
exports
field more directly, the exports
field has supported this style of pathing since node 12.16.0
I'm still not sure why you feel this is an issue with the package when your ide is the only thing reporting an issue, typescript has no issues compiling, and there are no issues actually running the code
if you really want to make an issue on github, you can, but I'm just telling you the issue is more likely to be locali wasn't saying it was any issues with the code, i was just wondering if there could have been a mixup with importing the types
that's what my question was about
and it appears to be a pretty common issue given theres less than 5k npm downloads a month
most of which won't be using http-only
i'll try messing around with my tsconfig since that's what they went on to do in this