Skip to content
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

[BUG] TypeScript v5.5 breaks build #78

Closed
ExampleWasTaken opened this issue Aug 5, 2024 · 4 comments · Fixed by #84
Closed

[BUG] TypeScript v5.5 breaks build #78

ExampleWasTaken opened this issue Aug 5, 2024 · 4 comments · Fixed by #84
Assignees
Labels
dependencies Pull requests that update a dependency file

Comments

@ExampleWasTaken
Copy link
Contributor

ExampleWasTaken commented Aug 5, 2024

Description

A bug fix in TS v5.5 breaks our build.

It happens because discord.js export their own declarations for node:events. This causes TS to use those declarations instead of the ones from @types/node in src/lib/db.ts#L16. These types being incorrect fails the build.

At the moment we use TypeScript v5.3.3 which doesn't have the bug fix and therefore doesn't break our build.

Expected behavior

TypeScript should use the correct types at all times.

Steps to reproduce

  1. Install the latest TypeScript version using
npm i -D typescript@latest
  1. Run
npm run dev

Important

VSCode users, make sure you use the workspace typescript version as VSC uses its bundled TS version by default.

Note

Once done with testing, make sure to reset your workspace by running

git reset --hard & npm i

References

@ExampleWasTaken ExampleWasTaken changed the title TypeScript v5.5 breaks build [BUG] TypeScript v5.5 breaks build Aug 5, 2024
@alepouna
Copy link
Member

alepouna commented Aug 6, 2024

Seems like d.js is patching it with this PR discordjs/discord.js#10360, once this is merged we can update d.js and it should be fine (?)

bug that became a feature for some, is now being patched 🤣

@ExampleWasTaken
Copy link
Contributor Author

Seems like d.js is patching it with this PR discordjs/discord.js#10360, once this is merged we can update d.js and it should be fine (?)

bug that became a feature for some, is now being patched 🤣

Good spot! I'll subscribe to the PR and update our dependency once it's merged. (I hope it's that simple lol)

Feel free to assign me this issue :)

@alepouna alepouna added the dependencies Pull requests that update a dependency file label Aug 6, 2024
@ExampleWasTaken
Copy link
Contributor Author

discordjs/discord.js#10360 has been merged, currently waiting on a new release from them

@ExampleWasTaken
Copy link
Contributor Author

discord.js v14.16.0 has been released which includes the fix that's supposed to fix our issue.

I probably won't be able to work on it till the weekend though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants