totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

Please help to fix Bug in REST COMPONENT #780

Closed nowachri-de closed 3 years ago

nowachri-de commented 3 years ago

Steps to reproduce bug:

  1. Clone emptyproject-flow
  2. Execute npm install total4
  3. Execute node index.js --debug

`DEBUG PID: 3719 (v4)

PID : 3726 Node.js : v14.17.5 Total.js : v4 OS : linux 4.19.128-microsoft-standard Memory : 10.39 MB / 16.23 MB User : root

Name : Total.js Flow Version : 1.0.0 Date : 2021-08-12 16:56:32 Mode : debug

Directory : /mnt/c/nowak/development/git/emptyproject-flow node_modules : /mnt/c/nowak/development/git/emptyproject-flow/node_modules/total4/

http://0.0.0.0:8000/ `

  1. Install Rest Components

image

  1. Place a REST ROUTE and configure as shown in image

image

  1. Hit Apply Settings in REST ROUTE configuration dialog
  2. Hit Apply Button in top left corner

The following error will appear in the console.

SyntaxError: Unexpected token ';' at new Function () at Component.instance.reconfigure (/mnt/c/nowak/development/git/emptyproject-flow/flow/restroute.js:193:12) at Component.exports.install (/mnt/c/nowak/development/git/emptyproject-flow/flow/restroute.js:310:11) at Object.FLOW.init (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1650:18) at /mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1527:9 at Object.FLOW.reset (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1558:22) at Object.FLOW.changes (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1525:8) at WebSocket. (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:546:9) at WebSocketProto.emit (/mnt/c/nowak/development/git/emptyproject-flow/node_modules/total4/index.js:14592:11) at WebSocketClientProto.$decode (/mnt/c/nowak/development/git/emptyproject-flow/node_modules/total4/index.js:15378:21) ======= 2021-08-12 17:03:58: SyntaxError: Unexpected token ';' SyntaxError: Unexpected token ';' at new Function () at Component.instance.reconfigure (/mnt/c/nowak/development/git/emptyproject-flow/flow/restroute.js:193:12) at Component.exports.install (/mnt/c/nowak/development/git/emptyproject-flow/flow/restroute.js:310:11) at Object.FLOW.init (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1650:18) at /mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1527:9 at Object.FLOW.reset (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1558:22) at Object.FLOW.changes (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1525:8) at WebSocket. (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:546:9) at WebSocketProto.emit (/mnt/c/nowak/development/git/emptyproject-flow/node_modules/total4/index.js:14592:11) at WebSocketClientProto.$decode (/mnt/c/nowak/development/git/emptyproject-flow/node_modules/total4/index.js:15378:21)

petersirka commented 3 years ago

Hello @nowachri-de, Currently, REST components aren't optimized for the Total.js v4. We try to optimize them next week, ok?

nowachri-de commented 3 years ago

Thanks, for the fast answer !!!!! Can you please tell me, how I can run the example using V3?

Thanks a lot Christian

petersirka commented 3 years ago

Just update /yourapp/index.js and rewrite total4 to total.js: https://github.com/totaljs/framework4/blob/master/helpers/index.js#L31

nowachri-de commented 3 years ago

Hello Peter,

same issue running V3:

DEBUG PID: 3785 (v3.4.9)

PID : 3792 Node.js : v14.17.5 Total.js : v3.4.9 OS : linux 4.19.128-microsoft-standard Memory : 10.94 MB / 17.05 MB User : root

Name : Total.js Flow Version : 1.0.0 Date : 2021-08-12 17:39:33 Mode : debug

Directory : /mnt/c/nowak/development/git/emptyproject-flow node_modules : /mnt/c/nowak/development/git/emptyproject-flow/node_modules/total.js/

http://0.0.0.0:8000/

SyntaxError: Unexpected token ';' at new Function () at Component.instance.reconfigure (/mnt/c/nowak/development/git/emptyproject-flow/flow/restroute.js:193:12) at Component.exports.install (/mnt/c/nowak/development/git/emptyproject-flow/flow/restroute.js:310:11) at Object.FLOW.init (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1650:18) at /mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1527:9 at Object.FLOW.reset (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1558:22) at Object.FLOW.changes (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1525:8) at WebSocket. (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:546:9) at WebSocketProto.emit (/mnt/c/nowak/development/git/emptyproject-flow/node_modules/total.js/index.js:15482:11) at WebSocketClientProto.$decode (/mnt/c/nowak/development/git/emptyproject-flow/node_modules/total.js/index.js:16380:21) ======= 2021-08-12 17:40:12: SyntaxError: Unexpected token ';' SyntaxError: Unexpected token ';' at new Function () at Component.instance.reconfigure (/mnt/c/nowak/development/git/emptyproject-flow/flow/restroute.js:193:12) at Component.exports.install (/mnt/c/nowak/development/git/emptyproject-flow/flow/restroute.js:310:11) at Object.FLOW.init (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1650:18) at /mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1527:9 at Object.FLOW.reset (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1558:22) at Object.FLOW.changes (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:1525:8) at WebSocket. (/mnt/c/nowak/development/git/emptyproject-flow/tmp/flow.package/index.js:546:9) at WebSocketProto.emit (/mnt/c/nowak/development/git/emptyproject-flow/node_modules/total.js/index.js:15482:11) at WebSocketClientProto.$decode (/mnt/c/nowak/development/git/emptyproject-flow/node_modules/total.js/index.js:16380:21)

petersirka commented 3 years ago

It's my bug. Please download/update flow.package again. I have added a missing validation for configuration forms.

There was a problem with the required fields, and the configuration form allowed you to send invalid data.

nowachri-de commented 3 years ago

Dear Peter,

thank you. Using V3 it works. It seems that for V4 there are still some things to do.

Thanks again Christian