marcy-terui / serverless-alexa-skills

Manage your Alexa Skills with Serverless Framework
https://www.npmjs.com/package/serverless-alexa-skills
MIT License
71 stars 13 forks source link

Cannot read property 'rhs' of undefined #11

Closed deadcore closed 6 years ago

deadcore commented 6 years ago

When running the following command: serverless alexa update -d I get the following output:

  Type Error ---------------------------------------------

  Cannot read property 'rhs' of undefined

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

Steps to reproduce:

  1. Execute serverless alexa auth
  2. Execute: serverless alexa create --name "Test" --locale "en-GB" --type "custom"
  3. serverless.yml looks like this:
    custom:
    alexa:
    vendorId: ${env:AMAZON_VENDOR_ID}
    clientId: ${env:AMAZON_CLIENT_ID}
    clientSecret: ${env:AMAZON_CLIENT_SECRET}
    skills:
      - id: amzn1.ask.skill....
        skillManifest:
          publishingInformation:
            locales:
              en-GB:
                name: Test
          apis:
            custom: {}
          manifestVersion: '1.0'
        models:
          en-GB:
            interactionModel:
              languageModel:
                invocationName: hello
                intents:
                  - name: AMAZON.CancelIntent
                    samples: []
                  - name: AMAZON.HelpIntent
                    samples: []
                  - name: AMAZON.StopIntent
                    samples: []
                  - name: HelloWorldIntent
                    samples:
                    - hello
                    - say hello
                    - hello world
  4. Execute: serverless alexa update -d

Solution:

Running with debug gives this:

  Type Error ---------------------------------------------

  Cannot read property 'rhs' of undefined

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Stack Trace --------------------------------------------

TypeError: Cannot read property 'rhs' of undefined
    at deepDiff (/Users/j.liddiard/Projects/alexa-whats-on/node_modules/deep-diff/index.js:157:77)
    at accumulateDiff (/Users/j.liddiard/Projects/alexa-whats-on/node_modules/deep-diff/index.js:213:3)
    at AlexaSkills.<anonymous> (/Users/j.liddiard/Projects/alexa-whats-on/node_modules/serverless-alexa-skills/lib/diffSkills.js:17:19)
From previous event:
    at PluginManager.invoke (/Users/j.liddiard/.nvm/versions/node/v8.9.4/lib/node_modules/serverless/lib/classes/PluginManager.js:372:22)
    at PluginManager.run (/Users/j.liddiard/.nvm/versions/node/v8.9.4/lib/node_modules/serverless/lib/classes/PluginManager.js:403:17)
    at variables.populateService.then (/Users/j.liddiard/.nvm/versions/node/v8.9.4/lib/node_modules/serverless/lib/Serverless.js:102:33)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
    at Serverless.run (/Users/j.liddiard/.nvm/versions/node/v8.9.4/lib/node_modules/serverless/lib/Serverless.js:89:74)
    at serverless.init.then (/Users/j.liddiard/.nvm/versions/node/v8.9.4/lib/node_modules/serverless/bin/serverless:42:50)
    at <anonymous>

Seems to be caused by lib/diffSkills.js line 12: const local = localSkills.find(skill => skill.id === remote.skillId); and remote.skillId needs to be lower case id

deadcore commented 6 years ago

I was being a muppet, the README needs updating mind

robboerman2 commented 6 years ago

currently having the same problem

SeriesOfUnlikelyExplanations commented 4 years ago

Ran into this too. "skillManifest:" should be "manifest:".

qriomatrix commented 3 years ago

Ran into this too. "skillManifest:" should be "manifest:". This is working fine.