Code Monkey home page Code Monkey logo

Comments (14)

maxtull avatar maxtull commented on June 2, 2024 1

I removed node_modules and ran npm install targetting Discord.JS v14.12.1 (Also upgraded to Node v16.13.0). The issue still occured when the project was ran, however this may have been caused by NPM caching packages - I didn't think of that at the time but thats likely what it was. I have reverted to v14.11 for now and will wait for further updates.

from discord.js.

maxtull avatar maxtull commented on June 2, 2024

Updated to Node v18 as specified in the rest 2.0.0 milestone changelog.

from discord.js.

iCrawl avatar iCrawl commented on June 2, 2024

16.11 is fine too, and shouldn't be too problematic for now.

from discord.js.

maxtull avatar maxtull commented on June 2, 2024

Reopened because this affects Discord.JS directly itself when updating from 14.11.* to 14.12.1.

from discord.js.

maxtull avatar maxtull commented on June 2, 2024

16.11 is fine too, and shouldn't be too problematic for now.

Ah cheers, I'll downgrade to 16.11. Might wanna update docs if possible, thanks for the quick reply.

from discord.js.

ckohen avatar ckohen commented on June 2, 2024

FYI, the Node 18 requirement was reverted as to avoid a major bump in discord.js, and as crawl said, this feature was added in Node 16.11 which I think is a reasonable enough expectation to update to when updating dependencies. Will work on a solution to either fix the way tsc compiles this or document it.

from discord.js.

GodderE2D avatar GodderE2D commented on June 2, 2024

FYI, the Node 18 requirement was reverted as to avoid a major bump in discord.js, and as crawl said, this feature was added in Node 16.11 which I think is a reasonable enough expectation to update to when updating dependencies. Will work on a solution to either fix the way tsc compiles this or document it.

In this case, docs should be updated to reflect this, right?

from discord.js.

sdanialraza avatar sdanialraza commented on June 2, 2024

The 2.0.0 release says 18+ is required because of the use of global fetch so a bit confused, is it 16.11+ or 18+?

from discord.js.

GodderE2D avatar GodderE2D commented on June 2, 2024

I'm not too sure but this workaround/polyfill should work for 16.11. So until v15, it should be 16.11+.

https://github.com/discordjs/discord.js/blob/main/packages/rest/src/index.ts#L7

from discord.js.

ckohen avatar ckohen commented on June 2, 2024

That breaking change comment was left in because that commit had 4 other breaking changes, the revert of the engine requirement bump happened later and the changelog generator did not pick it up for some reason.

Also, the reason it was reverted in the first place is that the bump was not actually necessary since we don't use global fetch in node, only in web / web-like environments.

from discord.js.

maxtull avatar maxtull commented on June 2, 2024

Just downgraded to 16.11 and the issue is still occuring?

from discord.js.

ckohen avatar ckohen commented on June 2, 2024

To be clear, the same issue is occurring?

The parsing of this syntax was added in v8 9.4.146, which Node updated to in 16.11.0. I also tested this with a minimum reproducible sample in 16.10 and 16.11 to confirm this, and the sample ran fine on 16.11 as expected.

from discord.js.

ckohen avatar ckohen commented on June 2, 2024

I made a fresh package, installed discord.js and created a file that only imported discord.js, it crashed on 16.10 as expected, and ran fine on 16.11 in both cjs and esm.

If you are using some type of process manager, make sure it is updating when you update your global version of node, especially if you have multiple versions of node installed at the same time.

from discord.js.

maxtull avatar maxtull commented on June 2, 2024

Inactive, issue resolved with Node v16.11+. Docs may need to be updated to include the version bump (assuming they are not already). Thanks for the help. 👍

from discord.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.