message.client.guilds.fetch() is not a function - javascript

Here's the relevant snippet of the code I was working on:
message.client.guilds.fetch('ID Here', false).then(guild => message.channel.send(guild.name))
According do the discord.js docs, this function, GuildManager#fetch(), should theoretically work. However, I keep getting this error:
message.client.guilds.fetch is not a function
I even tried directly copying and pasting the example from the function docs, but it still gave me the same error.
I'm fairly stumped, any help would be appreciated!
Edit: I should mention that all other discord.js fetch methods are working fine, such as:
message.channel.messages.fetch()
Edit #2: My previous problem has been solved, I was using the wrong version of discord.js. However, I now get a new error:
DiscordAPIError: Missing Access
When running it.

You are most likely using an outdated discord.js version. client.guilds was made a GuildManager as of v12.0.0 and the method client.guilds.fetch was added only in the latest version v12.3.0. You need to have a discord.js version >= 12.3.0 in order to use this method.
Try npm ls discord.js to check the active version in your dependencies.
Try npm i discord.js#latest to forcefully upgrade to latest version.

Related

How to fix VS Code unable to create a strapi app?

I'm Having an issue that ruins my entire development plans, And I don't think I'm even the problem!
There is an headless CMS program (open source) called Strapi, If you know the program then good, If not, Your more than welcome to try and tell me if you can help me with this problem.
I'm having trouble creating a Strapi app in VSCode.
The error that I'm receiving is:
You are running Node.js 18.4.0
Strapi requires Node.js >=14.19.1 <=16.x.x
Please make sure to use the right version of Node.
But, The fault isn't on me, I have 16.17.0 version of node installed, and without a trace of the 18.4 version specified on the error code.
I tried uninstalling node, Changing the dependencies in the launch.json file, Nothing worked!
So I Found the solution, the problem was with the version, the recommended 16.17.0 version of node not working with strapi, the 16.15.0 works actually.

Error: "Command "maximizeWindow" is not yet implemented" using webdriverIO v6

I have a project on webdriverIOv5 which I have tried to upgrade to version 6.
But when calling browser.maximizeWindow(), then I get this as an error:
ERROR #wdio/sync: Error: Command "maximizeWindow" is not yet implemented
Here is my demo project https://github.com/mareru/webdriverIO-shop-demo.
Does anybody know how to fix this?
I did find some similar references on gitter but according to them, this should work.
I don't get what am I doing wrong.
Thanks!
maximizeWindow was removed when chromedriver switched from json wire to W3C protocol and reimplemented a couple of versions ago.
Make sure to use the latest version of chromedriver. You have to configure selenium-standalone service according to https://webdriver.io/docs/selenium-standalone-service.html#configuration in your config https://github.com/mareru/webdriverIO-shop-demo/blob/master/src/wdio.conf.ts#L95
Verified in my own example repo https://gitlab.com/bar_foo/wdio-cucumber-typescript/-/blob/master/config/wdio.CHROME.conf.ts

Meteor update isopacket giving `combined` error - sourcemapConsumer.destroy is not a function

Every time I try to update a project or create a project with 1.9 and above in Meteor I get the following error:
Errors prevented isopacket load:
While loading isopacket `combined`:
C:\Users\USER\AppData\Local\.meteor\packages\meteor-tool\1.9.2\mt-os.windows.x86_64\tools\fs\tools\fs\files.ts:1170:25: sourcemapConsumer.destroy is not a function
...
Don't know why this error keeps showing up. I have already uninstalled and reinstalled Meteor.
The error is sourcemapConsumer.destroy is not a function
I can use meteor create and meteor run with versions 1.8.3 and below. My old programs still run. Sometimes with meteor 1.9 it will create a project while still providing the error and if I try to run the code I get the same error again.
While this is not a perfect solution, what helped me out to get to version 1.10.2 was modifying files.js and linker.js. I have suggested how meteor repo may be fixed and how I got it running on my Windows 10 64-bit machine in this answer:
https://github.com/meteor/meteor/issues/10930#issuecomment-630721277
I hope my hacky method helps anyone struggling. If there is a better solution please mention it so others can also benefit.
Hope this helps!

Bigcommerce Stencil 500 error

I am trying to get stencil set up on a trial store. I have a stencil theme set as default, installed node 4.4.0 as recommended, everything goes fine. Stencil start goes fine. but when I access the site through the browser I get the following error:
Debug: internal, implementation, error
TypeError: Uncaught error: self.assembler.getTranslations is not a function
at Paper.loadTranslations (/Users/oliverharoun/.nvm/versions/node/v4.4.0/lib/node_modules/#bigcommerce/stencil-cli/node_modules/#bigcommerce/stencil-paper/index.js:137:20)
at /Users/oliverharoun/.nvm/versions/node/v4.4.0/lib/node_modules/#bigcommerce/stencil-cli/node_modules/#bigcommerce/stencil-paper/index.js:62:18
at /Users/oliverharoun/.nvm/versions/node/v4.4.0/lib/node_modules/#bigcommerce/stencil-cli/node_modules/async/lib/async.js:718:13
at async.forEachOf.async.eachOf (/Users/oliverharoun/.nvm/versions/node/v4.4.0/lib/node_modules/#bigcommerce/stencil-cli/node_modules/async/lib/async.js:233:13)
at _parallel (/Users/oliverharoun/.nvm/versions/node/v4.4.0/lib/node_modules/#bigcommerce/stencil-cli/node_modules/async/lib/async.js:717:9)
at Object.async.parallel (/Users/oliverharoun/.nvm/versions/node/v4.4.0/lib/node_modules/#bigcommerce/stencil-cli/node_modules/async/lib/async.js:731:9)
at Paper.loadTheme (/Users/oliverharoun/.nvm/versions/node/v4.4.0/lib/node_modules/#bigcommerce/stencil-cli/node_modules/#bigcommerce/stencil-paper/index.js:60:11)
at respond (/Users/oliverharoun/.nvm/versions/node/v4.4.0/lib/node_modules/#bigcommerce/stencil-cli/server/plugins/renderer/responses/pencil-response.js:29:15)
at /Users/oliverharoun/.nvm/versions/node/v4.4.0/lib/node_modules/#bigcommerce/stencil-cli/server/plugins/renderer/renderer.module.js:49:18
at /Users/oliverharoun/.nvm/versions/node/v4.4.0/lib/node_modules/#bigcommerce/stencil-cli/server/plugins/renderer/renderer.module.js:246:24
All is working well for me in Node 4.4.5, but I have encountered these errors in the past. Deleting the node_modules folder and running npm i to do a fresh reinstall usually fixes the problem for me. If trouble persists, you may want to uninstall the global #bigcommerce/stencil-cli package and reinstall.
If you pull down the latest version of Stencil (just deployed in the last couple hours), you should have a fix for this. It was an issue introduced in a previous (recent) release.

Installing Nodejitsu

I have successfully installed NodeJitsu using NPM. However, anytime I attempt to run it I get the following error:
TypeError: Arguments to path.join must be strings.
It happens at line 204 in path.js
Any ideas?
We are working on release our toolset with node 0.10.0 support, you can use it with the last 0.8.x branch (0.8.22). We will publish a new version as soon as possible.
This issue is fixed internally but we are working on all the possible points of failure in node 0.10.0.
Stay tunned for updates!
If you need support you can join #nodejitsu on Freenode ;)

Categories

Resources