Tomato6966 / lavalink-client

Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients.
https://tomato6966.github.io/lavalink-client/
MIT License
48 stars 13 forks source link

Cannot find module 'tslib' - Seyfert discord library #24

Closed EvilG-MC closed 5 months ago

EvilG-MC commented 5 months ago

I installed lavalink-client to be used in another library outside discord.js, and at the moment of instantiating it, I get this error:

Error: Cannot find module 'tslib'
Require stack:
- C:\Users\JustEvil\Desktop\Stuff\djs stuff\maku-bot\node_modules\.pnpm\github.com+tomato6966+lavalink-client@525699b9a27cc83e048813474f21dcf3e48d513e\node_modules\lavalink-client\dist\cjs\index.js

To prevent saturation, I uploaded the content to sourceb.in. tsconfig.json: https://sourceb.in/sN8BUvip20 package.json: https://sourceb.in/8xzdqga4aB

I'm using Seyfert instead of discord.js The thing changes when I install discord.js and I don't get the error.

Issue: (ignore the modified terminal haha) WindowsTerminal_u9ongTc0eF

UnschooledGamer commented 5 months ago

I installed lavalink-client to be used in another library outside discord.js, and at the moment of instantiating it, I get this error:

Error: Cannot find module 'tslib'
Require stack:
- C:\Users\JustEvil\Desktop\Stuff\djs stuff\maku-bot\node_modules\.pnpm\github.com+tomato6966+lavalink-client@525699b9a27cc83e048813474f21dcf3e48d513e\node_modules\lavalink-client\dist\cjs\index.js

To prevent saturation, I uploaded the content to sourceb.in. tsconfig.json: https://sourceb.in/sN8BUvip20 package.json: https://sourceb.in/8xzdqga4aB

I'm using Seyfert instead of discord.js The thing changes when I install discord.js and I don't get the error.

Issue: (ignore the modified terminal haha) WindowsTerminal_u9ongTc0eF

Hello, the error occurs cause tslib is set to be an devDependencies for now I'll request you to install tslib for now it should work, I don't know why it doesn't error while using discord.js.

@Tomato6966 Kindly Look into, It's probably cause of importHelpers config option in tsconfig or the package being set in devDependencies.

Tomato6966 commented 5 months ago

How did you install lavalink-client? It seems that, you installed it from github, and included the src folders? The released npm project does not contain the src project and thus not require the typescript files nor the dev dependencies also it's up to date. Could you show what is ls node_modules/lavalink-client

UnschooledGamer commented 5 months ago

How did you install lavalink-client? It seems that, you installed it from github, and included the src folders? The released npm project does not contain the src project and thus not require the typescript files nor the dev dependencies also it's up to date. Could you show what is ls node_modules/lavalink-client

I'm here confused, you mean src the src directory or dist as that's what gets packed after compiling.

Tomato6966 commented 5 months ago

src === source dist === package you need, which is plain js (1 cjs, 1 mjs, and types)

UnschooledGamer commented 5 months ago

src === source dist === package you need, which is plain js (1 cjs, 1 mjs, and types)

But doesn't the error stack tell that it's using JS files(built ones) in the require stack section?

Tomato6966 commented 5 months ago

With the latest commit i moved tslib to the required packages, my bad

Could you re-try and see if it solves the issue (on github) then i'll publish the change(s)

UnschooledGamer commented 5 months ago

sure, just min.

UnschooledGamer commented 5 months ago

With the latest commit i moved tslib to the required packages, my bad

Could you re-try and see if it solves the issue (on github) then i'll publish the change(s)

It resolves the Error.