SimonLeclere / discord-easy-dashboard

💻 Simple module to facilitate the creation of dashboard using discord.js and express
https://www.npmjs.com/package/discord-easy-dashboard
71 stars 11 forks source link

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. #19

Closed HeCodes2Much closed 2 years ago

HeCodes2Much commented 2 years ago
node:internal/validators:120
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:372:5)
    at validateString (node:internal/validators:120:11)
    at join (node:path:1172:7)
    at Dashboard._getTheme (/mnt/500GB/.gitlabs/DiscordBot/node_modules/discord-easy-dashboard/index.)
    at new Dashboard (/mnt/500GB/.gitlabs/DiscordBot/node_modules/discord-easy-dashboard/index.js:48:)
    at Object.<anonymous> (/mnt/500GB/.gitlabs/DiscordBot/Structures/index.js:22:19)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
  code: 'ERR_INVALID_ARG_TYPE'
}
SimonLeclere commented 2 years ago

Hey, this error comes from a typo I made in the code. Try adding theme: 'light' to your dashboard options. I'll push a fix soon

HeCodes2Much commented 2 years ago

@SimonLeclere i did that then when i go to dashboard and one i am loged in i get this error

node_modules/discord-easy-dashboard/themes/light/selector.ejs:4 2| 3|
>> 4| <% guilds.forEach(guild => { 5| const permsOnGuild = new Perms(guild.permissions.toString()); 6| if(!permsOnGuild.has(req.dashboardConfig.permissions)) return; 7| %> req is not defined

EDIT using theme: "dark" seems to fix that

SimonLeclere commented 2 years ago

Mmh that's weird. I'll try to reproduce the error later

HeCodes2Much commented 2 years ago

dark theme seems to have this issue though :)

/node_modules/discord-easy-dashboard/themes/dark/guild.ejs:19 17|

<%= setting.name %>
18|

<%= setting.description %>
>> 19| 20| <% } else if (setting.type === 'boolean input') { %> 21|

<%= setting.name %>
22|
setting.get is not a function
SimonLeclere commented 2 years ago

Hey, so I think your errors come from mistakes in your code (like not specifying a getter when adding a parameter for example ;)

HeCodes2Much commented 2 years ago

some times a random refresh fixed the issue some how