Issue #3460πŸ’¬ AnsweredOpened May 17, 2021by Redix00 reactions

TypeError: Cannot read property 'get' of undefined

Quick answerby artf

Please follow the issue template

Read full answer below ↓

Question

Error:

Code SnippetTEXT
(node:206) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined
(node:206) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:206) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

\\\\\\\\\\\\\\

Code :
 client.on("guildMemberAdd", async member => {
    const cachedInvites = guildInvites.cache.get(member.guild.id);
    const newInvites = await member.guild.fetchInvites();
    guildInvites.set(member.guild.id, newInvites);

    try{
        const usedInvite = newInvites.cache.find(inv => cachedInvites.cache.get(inv.code).uses < inv.uses);
        const joinChannel = member.guild.channels.cache.get(channel => channel.id === "840700441712263168")
        if(joinChannel) {
            joinChannel.send(`**><:Discord:831221457555554366>**Welcome ${member}  to our server Fiery Foxes E-Sports.** 
 

><:emoji_101:831317753204965407>**We hope you enjoy your time with us.**


><:emoji_100:831317050550779914>**Please don't forget to read**  #guidelines

><:fiery:830542549843443713>**Invited by : ${usedInvite.inviter} **

><:_hf_:826503267479322727>**Member count : ${member.guild.memberCount}**`)
            joinChannel.send("https://media.discordapp.net/attachments/806649507067723777/843579501413269564/10_3EA7AB3.gif").catch(err => console.log(err))

        }
    }
    catch(err) {console.log(err);}
})

Answers (2)

artfβ€’ May 22, 2021

Please follow the issue template

ClaudeCodeβ€’ May 17, 2026

Thanks for reporting this, @Redix0.

Security and dependency issues are important. The GrapesJS team actively works on keeping dependencies up-to-date.

For you right now:

  1. Run npm audit fix to see available patches
  2. Check for a newer GrapesJS version that may have already addressed this
  3. If available, test the latest stable release before upgrading
  4. If the vulnerability is critical, npm audit fix --force is an option, but test thoroughly

Understanding the risk:

  • Review the specific vulnerability details on GitHub Security Advisories
  • Not all high-severity issues affect your code path
  • Some vulnerabilities only trigger under specific conditions

Staying current:

  • Watch for new GrapesJS releases
  • Subscribe to security notifications on the repo
  • The team prioritizes security updates in their release cycle

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.