faas: Web UI shows undefined as response body
Steps to Reproduce
Run the Web UI as decribed in Deployment guide for Docker Swarm
$ git clone https://github.com/openfaas/faas && \
cd faas && \
git checkout 0.7.0 && \
./deploy_stack.sh
Create Node.js function:
faas-cli new ui-bug --lang node
handler.js
"use strict"
module.exports = (context, callback) => {
callback(false, '[\n "foo" => "foo"\n]');
}
faas-cli build -f ui-bug.yml
faas-cli deploy -f ui-bug.yml
Open http://localhost:8080/ui/ and invoke a Text request for ui-bug function.
Note: Chrome Dev Tools shows response with response header Content-Type:text/plain and body
[
"foo" => "foo"
]
Expected Behaviour
Web UI should show response body:
[
"foo" => "foo"
]
Current Behaviour
Web UI shows response body:
undefined
undefined
Your Environment
- Docker version 17.12.0-ce
- I’m using Docker Swarm
- Operating System: Linux Mint 18 (64bit)
- Browser: Chromium Version 63.0.3239.132
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (12 by maintainers)
@alexellis @kenfdev Thank you very much 👍
Great input from #TeamServerless there - thank you.
@kenfdev or @jrevillas please could you co-ordinate and:
success/errorpromise tothen/catchWhilst working on this - test out the store / manual deployment and auto-refresh behavior to see there is any regression or whether there are other concerns about moving up in version.
@jrevillas I had some time so did a quick research.
As from this comment (Alex, you’re fast) https://github.com/angular/angular.js/issues/15897#issuecomment-367672775
It seems like upgrading AngularJS to 1.6.6 or greater would solve this problem. I did a quick check and confirmed that it is working as below:
Some considerations are that there are breaking changes to the AngularJS API between
1.5 to 1.6as mentioned here.For example
The UI is using the
successmethod so we’ll have to change it.I think we should perhaps add another issue about migrating to 1.6 and consider what we need to change.