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

Cannot set cloud variables #1

Open
WilsontheWolf opened this issue May 21, 2019 · 0 comments
Open

Cannot set cloud variables #1

WilsontheWolf opened this issue May 21, 2019 · 0 comments

Comments

@WilsontheWolf
Copy link

WilsontheWolf commented May 21, 2019

I cannot set a cloud variable using this. The error I get is

(node:4069) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'set' of undefined
    at CloudSession.setVariable (/rbd/pnpm-volume/e38efa70-1bc7-452e-891e-f660e6a03dfd/node_modules/.registry.npmjs.org/node-scratch-client/1.3.7/node_modules/node-scratch-client/src/Struct/CloudSession.js:35:27)
at cloud.connect.then (/app/server.js:41:9)
(node:4069) 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(). (rejection id: 1)
(node:4069) [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:```js
const config = require("./config.json");
const scratch = require("node-scratch-client");

const Client = new scratch.Client({
  username: config.username,
  password: config.password
});

Client.login().then(() => {
  let cloud = Client.session.createCloudSession(221003966);

  cloud.connect().then(() => {
    cloud.on("set", variable => {
      console.log("Variable \""+variable.name+"\" changed to " + variable.value);
        
    });
  cloud.setVariable('☁ Test', 'Test')//seting her. ☁ Test exists
  });
});```
@WilsontheWolf WilsontheWolf changed the title Cannot set cloud varibles Cannot set cloud variables May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant