Going to need another Node update [Discord.js + Node 16.6.0 requirement]

So for those following along that was a no-go. I tried using 14.6 locally and it throws an error, I believe it is using something introduced in Node 15 which wouldn’t exist. I’m a bit stuck right now and will have to rollback a copy in GitHub in order to get it working in Glitch again. That can only be considered a temporary fix of course as no new development can take place on the project.

Yes, this is expected because we don’t have any Node 16 version installed on containers. I recommend you don’t upgrade Discord.js to the version that requires Node 16.6 until we add it to containers.

More or less understood but I was using 14.6 before it was officially added (in so far as I know). This creates something of a dilemma as the published version can not be updated any longer or I have to target the pre-release version of DiscordJS.

If any bugs are discovered DiscordJs will simply tell me to upgrade to the release.

In any case I know you are looking into it… if nothing else perhaps there can be support for pre-release versions of things like the libraries offer. There is a warning, we are told it is a prerelease but there may be rational reasons to use it and we accept the risk.

I understand your dilemma and if you do need to use the prerelease, we understand if you end up hosting the bot elsewhere. We are focused on sticking to the official Node LTS release schedule, not of different NPM package prereleases. That being said, I did put a request in for the team to discuss and see what we can do!

1 Like

I have been using discord.js v13 dev version on node 14.17.3 for about 2 months and that is still working.
To install it you can run npm install discord.js@dev

Hi Crypto. Yes but that isn’t the release version as far as I can tell. If you encounter a bug and you post it to the DiscordJs discord group I will guess they will tell you to upgrade and get back to them.

Hello,

Is there any way to update to Node.js v16? Currently, glitch is restricted to Node v14 at the latest which causes great limitations for projects and packages.

Hi there, I’ve moved your post to this thread so you can follow updates on Node 16. In short, Glitch containers do not have Node 16 because it’s not an LTS release yet, but we know there is interest in it being available.

2 Likes

Support for Node 16 would be greatly appreciated as Node 14 is a limitation to a lot of applications.

Hello, I was just wondering if there is any update on the situation regarding Node 16 implementation.

If you only need node 16 for discordjs v13, I’m currently using an AbortController polyfill with node 14.15, and I haven’t had any problems (yet). Just install abortcontroller-polyfill and then add the following to the top of your main file:

const { AbortController } = require('abortcontroller-polyfill/dist/cjs-ponyfill');
global.AbortController = AbortController;

For any other library that needs node >14, take a look at what errors you get when runninv it in node 14, and see if there are polyfills for it - there will almost certainly be.

3 Likes

Yes this works as a temporary solution to the problem but hopefully, Glitch will add support for Node 16.X

Edit:
I don’t think this is possible as Discord.JS doesn’t use the global keyword.

Also, regarding this, it still throws the error AbortController is not defined. (AbortController is declared before anything)

I have created a temporary solution to this problem here:

1 Like

Hello again! We just deployed a change that will add Node 16.6 to containers. Due to our 12 hour container cycling schedule, though, it may take up to…12 hours for your projects to be able to use it, so update responsibly!

5 Likes

Thanks very much. The timing of these libraries wasn’t ideal but it was going to be troublesome to wait until October. Particularly for people who develop directly on Glitch, it meant they couldn’t even begin to migrate their code until then and they are going to encounter a number of “gotchas” in v13 due to library changes…

Two things. First a confirmation that everything worked. I updated my bot and have had no issues. The other is there was a patch issued for npm and while that doesn’t (probably) affect anyone it does mean that everyone using Node 16.6 will get that message. Maybe there is a way you can apply the patch to your containers as well?

npm notice
npm notice New patch version of npm available! 7.20.3 → 7.20.5
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.20.5
npm notice Run npm install -g npm@7.20.5 to update!
npm notice

We only support the version of NPM that comes with the version of Node that you’re using, we don’t patch/update those separately. If the version of NPM is causing issues with an LTS version of Node, though, do let us know.

Hello, I would like to know if nodejs 16 was ready, because when I change from 14 to 16, the console tells me that it goes back to 14
I hope to have an answer soon, good day/evening

Hi there - we did set up Node 16 awhile ago. Can you email support@glitch.com with the name of the project so we can confirm that your configuration is correct and see if it’s a bug on our end?