Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

258
Visualizações
Invalid bitfield flag or number: 37035584

I am working on a bot dashboard and currently the dashboard page doesn't want to display. Now I don't know my issue at all.

dashboard.ejs

<div class="servers">
<% user.guilds.forEach(guild => {
 const permsOnGuild = new perms(guild.permissions);
 if(!permsOnGuild.has("MANAGE_GUILD")) {
 return
 }
%>

Error

RangeError [BITFIELD_INVALID]: /home/runner/switch-beta-bot/dashboard/templates/dashboard.ejs:22
    20| 
    21| <div class="servers">
 >> 22| <% user.guilds.forEach(guild => {
    23|  const permsOnGuild = new perms(guild.permissions);
    24|  if(!permsOnGuild.has("MANAGE_GUILD")) {
    25|  return

Invalid bitfield flag or number: 37035584.
    at Function.resolve (/home/runner/switch-beta-bot/node_modules/discord.js/src/util/BitField.js:152:11)
    at new BitField (/home/runner/switch-beta-bot/node_modules/discord.js/src/util/BitField.js:17:38)
    at new Permissions (/home/runner/switch-beta-bot/node_modules/discord.js/src/util/Permissions.js:11:1)
    at eval ("/home/runner/switch-beta-bot/dashboard/templates/dashboard.ejs":23:23)
    at Array.forEach (<anonymous>)
    at eval ("/home/runner/switch-beta-bot/dashboard/templates/dashboard.ejs":22:20)
    at dashboard (/home/runner/switch-beta-bot/node_modules/ejs/lib/ejs.js:692:17)
    at tryHandleCache (/home/runner/switch-beta-bot/node_modules/ejs/lib/ejs.js:272:36)
    at View.exports.renderFile [as engine] (/home/runner/switch-beta-bot/node_modules/ejs/lib/ejs.js:489:10)
    at View.render (/home/runner/switch-beta-bot/node_modules/express/lib/view.js:135:8)
    at tryRender (/home/runner/switch-beta-bot/node_modules/express/lib/application.js:640:10)
    at Function.render (/home/runner/switch-beta-bot/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/home/runner/switch-beta-bot/node_modules/express/lib/response.js:1012:7)
    at renderTemplate (/home/runner/switch-beta-bot/dashboard/dashboard.js:132:11)
    at /home/runner/switch-beta-bot/dashboard/dashboard.js:633:7
    at Layer.handle [as handle_request] (/home/runner/switch-beta-bot/node_modules/express/lib/router/layer.js:95:5)
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

After about a few hours I actually found the fix to the code. It wasn't as easy as it looks.

NEW CODE

<% user.guilds.forEach(guild => {
 if(guild.permissions !== 2147483647) {
 return;
 }
%>

Now that solves my issue.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda