ibm-functions / shell

An Electron-based development tool for IBM Cloud Functions and Composer.
Apache License 2.0
60 stars 16 forks source link

error rendering an action #27

Closed rabbah closed 6 years ago

rabbah commented 6 years ago

i have an action where the shell's raw response is:

{
    "name": "unicode",
    "publish": false,
    "annotations": [{
        "key": "exec",
        "value": "nodejs:6"
    }, {
        "key": "web-export",
        "value": true
    }, {
        "key": "raw-http",
        "value": false
    }, {
        "key": "final",
        "value": true
    }],
    "version": "0.0.2",
    "exec": {
        "kind": "nodejs:6",
        "code": "function main(args) {\n    var str = args.delimiter + \" ☃ \" + args.delimiter;\n    console.log(str);\n    return { body: str };\n}\n",
        "binary": false
    },
    "parameters": [],
    "limits": {
        "timeout": 60000,
        "memory": 256,
        "logs": 10
    },
    "namespace": "guesr_demos"
}

and there's an error on the console and the code does not render:

Cannot read property 'value' of undefined TypeError: Cannot read property 'value' of undefined TypeError: Cannot read property 'value' of undefined
    at maybeAddWebBadge (file:///Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM%2…Functions%20Shell.app/Contents/Resources/app.asar/content/js/ui.js:931:159)
    at Object.self.showEntity (file:///Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM%2…Functions%20Shell.app/Contents/Resources/app.asar/content/js/ui.js:1102:25)
    at render (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64/IBM Cloud Functions Shell.app/Contents/Resources/app.asar/content/js/repl.js:263:32)
    at response (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64/IBM Cloud Functions Shell.app/Contents/Resources/app.asar/content/js/repl.js:287:5)
    at resolve (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64/IBM Cloud Functions Shell.app/Contents/Resources/app.asar/content/js/repl.js:603:104)
    at cmdPromise.then.then.response (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64/IBM Cloud Functions Shell.app/Contents/Resources/app.asar/content/js/repl.js:602:32)
    at process._tickCallback (internal/process/next_tick.js:103:7) TypeError: Cannot read property 'value' of undefined
    at maybeAddWebBadge (ui.js:931)
    at Object.self.showEntity (ui.js:1102)
    at render (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64…:263)
    at response (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64…:287)
    at resolve (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64…:603)
    at cmdPromise.then.then.response (/Users/rabbah/.node/lib/node_modules/@ibm-functions/shell/dist/IBM Cloud Functions Shell-darwin-x64…:602)
    at process._tickCallback (internal/process/next_tick.js:103)
starpit commented 6 years ago

this is a case where a web action does not have a content-type annotation. fixing

80e8ace4bf67e465aff9f9bf5eb8c0ea5d187cd9