Can't get started with @discordjs/core

Decided to mess around with /core today to see if it might be useful for a small lightweight project I'm planning. Following the example on GitHub gets me nowhere and just presents an error I don't fully understand.
Type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManager' is not assignable to type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManager'.
Types of property 'options' are incompatible.
Type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManagerOptions' is not assignable to type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManagerOptions'.
Type 'WebSocketManagerOptions' is not assignable to type 'OptionalWebSocketManagerOptions'.
Types of property 'buildStrategy' are incompatible.
Type '(manager: import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManager) => import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").IShardingStrategy' is not assignable to type '(manager: import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManager) => import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").IShardingStrategy'.
Types of parameters 'manager' and 'manager' are incompatible.
Type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManager' is not assignable to type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManager'.
Types of property 'options' are incompatible.
Type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManagerOptions' is not assignable to type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManagerOptions'.
Type 'WebSocketManagerOptions' is not assignable to type 'OptionalWebSocketManagerOptions'.
Types of property 'buildStrategy' are incompatible.
Type '(manager: import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManager) => import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").IShardingStrategy' is not assignable to type '(manager: import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManager) => import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").IShardingStrategy'.
Types of parameters 'manager' and 'manager' are incompatible.
Type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManager' is not assignable to type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManager'.
Types have separate declarations of a private property 'gatewayInformation'.
Type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManager' is not assignable to type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManager'.
Types of property 'options' are incompatible.
Type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManagerOptions' is not assignable to type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManagerOptions'.
Type 'WebSocketManagerOptions' is not assignable to type 'OptionalWebSocketManagerOptions'.
Types of property 'buildStrategy' are incompatible.
Type '(manager: import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManager) => import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").IShardingStrategy' is not assignable to type '(manager: import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManager) => import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").IShardingStrategy'.
Types of parameters 'manager' and 'manager' are incompatible.
Type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManager' is not assignable to type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManager'.
Types of property 'options' are incompatible.
Type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManagerOptions' is not assignable to type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManagerOptions'.
Type 'WebSocketManagerOptions' is not assignable to type 'OptionalWebSocketManagerOptions'.
Types of property 'buildStrategy' are incompatible.
Type '(manager: import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManager) => import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").IShardingStrategy' is not assignable to type '(manager: import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManager) => import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").IShardingStrategy'.
Types of parameters 'manager' and 'manager' are incompatible.
Type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/ws/dist/index").WebSocketManager' is not assignable to type 'import("/Users/<no>/Documents/GitHub/djs-core/node_modules/@discordjs/core/node_modules/@discordjs/ws/dist/index").WebSocketManager'.
Types have separate declarations of a private property 'gatewayInformation'.
This is using the example provided here: https://github.com/discordjs/discord.js/tree/main/packages/core The only alteration I have made is actually defining the token.
4 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
sludge
sludgeOP2y ago
@discordjs/core 0.5.0 Node 19.3.0 To clarify, that's a TS error produced by VS Code before I even attempt to run it I do, but I had to to be able to import WebSocketManager, /core doesn't re-export it restarting vs code does not remove the error @discordjs/[email protected] that is the full output oh sorry, I misread the package
sludge
sludgeOP2y ago
sludge
sludgeOP2y ago
all I did was run npm i @discordjs/core @discordjs/ws kinda weird that the package itself is calling an older version downgrading ws to 0.7.0 fixes it, just didn't expect that to be the issue lol. thanks
Want results from more Discord servers?
Add your server