question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Repeat doesn't work with APLA

See original GitHub issue

I’m submitting a…

  • Bug report
  • Feature request
  • Documentation issue or request
  • Other… Please describe:

Expected Behavior

At the end of the RepeatIntent handler, I return this.repeat() and the voice assistant should play the last output.

Current Behavior

It works on Google Assistant, but doesn’t work on Alexa. Probably this is related to the fact that I use APLA for outputSpeech on Alexa, so the field in the response is empty and Jovo doesn’t take into account the APLA directive.

Error log

{
    "errorType": "TypeError",
    "errorMessage": "Cannot read property 'replace' of null",
    "stack": [
        "TypeError: Cannot read property 'replace' of null",
        "    at Function.toSSML (/var/task/node_modules/jovo-core/dist/src/util/SpeechBuilder.js:24:21)",
        "    at AlexaCore.output (/var/task/node_modules/jovo-platform-alexa/dist/src/modules/AlexaCore.js:88:63)",
        "    at Middleware.run (/var/task/node_modules/jovo-core/dist/src/core/Middleware.js:76:30)",
        "    at Alexa.output (/var/task/node_modules/jovo-platform-alexa/dist/src/Alexa.js:121:42)",
        "    at Middleware.run (/var/task/node_modules/jovo-core/dist/src/core/Middleware.js:76:30)",
        "    at error (/var/task/node_modules/jovo-core/dist/src/plugins/Handler.js:205:67)",
        "    at processTicksAndRejections (internal/process/task_queues.js:97:5)",
        "    at async Middleware.run (/var/task/node_modules/jovo-core/dist/src/core/Middleware.js:76:21)",
        "    at async App.handle (/var/task/node_modules/jovo-core/dist/src/core/BaseApp.js:233:13)",
        "    at async App.handle (/var/task/node_modules/jovo-framework/dist/src/App.js:265:9)"
    ]
}

Your Environment

  • Jovo Framework version used: 3.2.2
  • Operating System: Windows 10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aswetlowcommented, Apr 1, 2021

Great!

You could also use $speech.addBreak('10ms');. Sometimes it looks cleaner than white space. Same same, but different 😂

0reactions
acerbisgianlucacommented, Apr 1, 2021

@aswetlow Thank you for your example, I think I’ve found the problem.

You return this.ask(' ', ' ') while I’m returning this.ask(this.$speech, this.$reprompt), but for the speech part I’m using APLA so this.$speech is empty and it’s stored in dynamo as null. When I call this.repeat() it throws the error (“Cannot read property ‘replace’ of null”).

"response": {
      "output": {
       "ask": {
        "speech": null,
        "reprompt": "<audio src=\"URL\"></audio> <audio src=\"https://URL\"></audio>"
       },
       "Alexa": {
        "Apl": [
         {
          "type": "Alexa.Presentation.APLA.RenderDocument",
          "token": "5",
          "document": {
           "type": "APLA",
           "mainTemplate": {
            "parameters": [
             "payload"
            ],
            "item": {
             "type": "Sequencer",
             "items": [
              {
               "type": "Audio",
               "source": "URL"
              },
              {
               "type": "Audio",
               "source": "URL"
              }
             ]
            }
           },
           "version": "0.8"
          }
         }
        ],
        "DisplayTemplate": {
         "type": "Display.RenderTemplate",
          "type": "BodyTemplate7",
          "token": "Launch",
          .........
         }
        }
       }
      },
      "speech": null,
      "reprompt": "<audio src=\"URL\"></audio> <audio src=\"URL\"></audio>"
     }

So I added this.$speech.addText(' ') only when the request is coming from Alexa and now it’s working!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Antiphospholipid Syndrome - StatPearls - NCBI Bookshelf - NIH
While not all patients with APLA develop APLS, there is a strong ... The criteria also require a repeat APLA test to be...
Read more >
Antiphospholipid Antibodies | Circulation
If a person has one positive APLA test followed by a negative APLA test 6 weeks later, the test should be repeated again...
Read more >
Antiphospholipid syndrome (APS) | Symptoms, treatments
Antiphospholipid syndrome (APS) causes blood clotting and recurrent miscarriage. Learn about the causes, symptoms and treatments.
Read more >
Antiphospholipid antibodies and the risk of recurrence after ...
This meta-analysis of 8 studies found evidence suggesting that patients with a first VTE who have APLA have a higher risk for recurrent...
Read more >
About APS | antiphospholipid syndrome | Blood tests
It is usually advisable to repeat the blood tests as one positive test for aPL does not necessarily mean that a person has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found