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

guilds.forEach is not a function error #31

Closed
tbhbestdevman opened this issue Sep 8, 2020 · 10 comments
Closed

guilds.forEach is not a function error #31

tbhbestdevman opened this issue Sep 8, 2020 · 10 comments
Labels
👾 Bug Something isn't working

Comments

@tbhbestdevman
Copy link

tbhbestdevman commented Sep 8, 2020

I get this error when I'm on the dashboard.

Error:

    9|       <div class="servers">
    10| 		  <h1 class="title">Servers you can manage:</h1>
 >> 11| 		  <% guilds.forEach((guild) => { %>
    12| 			<% if (!djsclient.guilds.has(guild.id)) { %>
    13| 			  <a id="invite-btn" target="_blank" href="https://discordapp.com/oauth2/authorize?client_id=492871769485475840&scope=bot&permissions=1506142455&guild_id=<%= guild.id %>">Invite to server
    14| 			  </a>

guilds.forEach is not a function
    at eval (/home/runner/Tsuyo-1/views/servers.ejs:15:15)
    at servers (/home/runner/Tsuyo-1/node_modules/ejs/lib/ejs.js:682:17)
    at tryHandleCache (/home/runner/Tsuyo-1/node_modules/ejs/lib/ejs.js:254:36)
    at View.exports.renderFile [as engine] (/home/runner/Tsuyo-1/node_modules/ejs/lib/ejs.js:485:10)
    at View.render (/home/runner/Tsuyo-1/node_modules/express/lib/view.js:135:8)
    at tryRender (/home/runner/Tsuyo-1/node_modules/express/lib/application.js:640:10)
    at Function.render (/home/runner/Tsuyo-1/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/home/runner/Tsuyo-1/node_modules/express/lib/response.js:1012:7)
    at router.get (/home/runner/Tsuyo-1/routes/servers.js:7:7)
    at Layer.handle [as handle_request] (/home/runner/Tsuyo-1/node_modules/express/lib/router/layer.js:95:5)
@ddinan
Copy link
Owner

ddinan commented Sep 8, 2020

Does this error show in console automatically or is there a way to replicate it? Also, if possible, which Discord.js version are you running?

@ddinan ddinan added the 👾 Bug Something isn't working label Sep 8, 2020
@tbhbestdevman
Copy link
Author

it shows on console when I go to the website servers page.

@tbhbestdevman
Copy link
Author

I use repl.it can that be a problem?

@ddinan
Copy link
Owner

ddinan commented Sep 16, 2020

Are you using Discord.JS v11? v12 is unstable atm.

As for repl.it, I'm not familiar with it alas. Try running locally via NPM/NodeJS and see if the error still occurs. It's weird that one aspect of the dashboard doesn't work while the rest does hm...

@tbhbestdevman
Copy link
Author

with dashboard disabled no error, And I can't run it off my computer because I have chromebook.

@tbhbestdevman
Copy link
Author

tbhbestdevman commented Sep 17, 2020

I'm using 12, I can't get 11. Repl.it gets the latest update of the packages automatically

@0x00032
Copy link

0x00032 commented Sep 18, 2020

This error is because you need to add djsclient.guilds.forEach istead of guilds.forEach

@tbhbestdevman
Copy link
Author

I'll try it

@tbhbestdevman
Copy link
Author

It fixed the http:https://spark.unobot.ga/servers error now there is another error when I go to manage the server.
TypeError: Cannot read property 'hasPermission' of undefined at router.get (/home/runner/Tsuyo-1/routes/server.js:18:71) at Layer.handle [as handle_request] (/home/runner/Tsuyo-1/node_modules/express/lib/router/layer.js:95:5) at next (/home/runner/Tsuyo-1/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/home/runner/Tsuyo-1/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/home/runner/Tsuyo-1/node_modules/express/lib/router/layer.js:95:5) at /home/runner/Tsuyo-1/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/home/runner/Tsuyo-1/node_modules/express/lib/router/index.js:335:12) at next (/home/runner/Tsuyo-1/node_modules/express/lib/router/index.js:275:10) at Function.handle (/home/runner/Tsuyo-1/node_modules/express/lib/router/index.js:174:3) at router (/home/runner/Tsuyo-1/node_modules/express/lib/router/index.js:47:12)

@tbhbestdevman
Copy link
Author

with the new bot update I still get the error

@ddinan ddinan closed this as completed in d5c4031 Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👾 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants