fbsamples / messenger-bot-samples

Messenger Bot Samples
Other
555 stars 441 forks source link

Internal server running the chat-extensions sample code #9

Closed matthewcheok closed 7 years ago

matthewcheok commented 7 years ago

I'm getting the following error:

017-05-07T01:04:38.961288+00:00 app[web.1]: ReferenceError: /app/views/index.ejs:22
2017-05-07T01:04:38.961292+00:00 app[web.1]:     20|             window.attachApp(
2017-05-07T01:04:38.961293+00:00 app[web.1]:     21|               context.psid,
2017-05-07T01:04:38.961293+00:00 app[web.1]:  >> 22|               <%= listId %>,
2017-05-07T01:04:38.961294+00:00 app[web.1]:     23|               "<%= socketAddress %>",
2017-05-07T01:04:38.961295+00:00 app[web.1]:     24|               context.thread_type);
2017-05-07T01:04:38.961296+00:00 app[web.1]:     25|           }, function error(err) {
2017-05-07T01:04:38.961296+00:00 app[web.1]:
2017-05-07T01:04:38.961297+00:00 app[web.1]: listId is not defined
2017-05-07T01:04:38.961298+00:00 app[web.1]:     at eval (eval at compile (/app/node_modules/ejs/lib/ejs.js:524:12), <anonymous>:22:26)
2017-05-07T01:04:38.961299+00:00 app[web.1]:     at returnedFn (/app/node_modules/ejs/lib/ejs.js:555:17)
2017-05-07T01:04:38.961300+00:00 app[web.1]:     at tryHandleCache (/app/node_modules/ejs/lib/ejs.js:203:34)
2017-05-07T01:04:38.961302+00:00 app[web.1]:     at View.render (/app/node_modules/express/lib/view.js:128:8)
2017-05-07T01:04:38.961301+00:00 app[web.1]:     at View.exports.renderFile [as engine] (/app/node_modules/ejs/lib/ejs.js:412:10)
2017-05-07T01:04:38.961302+00:00 app[web.1]:     at tryRender (/app/node_modules/express/lib/application.js:640:10)
2017-05-07T01:04:38.961303+00:00 app[web.1]:     at Function.render (/app/node_modules/express/lib/application.js:592:3)
2017-05-07T01:04:38.961304+00:00 app[web.1]:     at ServerResponse.render (/app/node_modules/express/lib/response.js:966:7)
2017-05-07T01:04:38.961304+00:00 app[web.1]:     at /app/routes/index.js:15:7
2017-05-07T01:04:38.961305+00:00 app[web.1]:     at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2017-05-07T01:04:38.961306+00:00 app[web.1]:     at next (/app/node_modules/express/lib/router/route.js:137:13)
2017-05-07T01:04:38.961306+00:00 app[web.1]:     at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
2017-05-07T01:04:38.961307+00:00 app[web.1]:     at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2017-05-07T01:04:38.961308+00:00 app[web.1]:     at /app/node_modules/express/lib/router/index.js:281:22
2017-05-07T01:04:38.961308+00:00 app[web.1]:     at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
2017-05-07T01:04:38.961309+00:00 app[web.1]:     at next (/app/node_modules/express/lib/router/index.js:275:10)
ghost commented 7 years ago

When exactly are you getting this error? Looks as if a webview is attempted to be opened without listId being provided. The code that calls into that is https://github.com/fbsamples/messenger-bot-samples/blob/master/chat-extensions/routes/lists.js#L23-L29

Maybe you haven't linked a DB to the bot?

matthewcheok commented 7 years ago

I followed the instructions to deploy the sample code to heroku. Is there any other setup required to link postgres?

ghost commented 7 years ago

@matthewcheok that's it no other setup required. When exactly does this happen? On my side I'm not able to repro something like this.

ghost commented 7 years ago

Closing due to no repro.

mahvine commented 7 years ago

This happens when locally running also to me

eoinclancy1 commented 7 years ago

I am seeing the same issue here too. Any Ideas as to how I can resolve this?

`2017-10-17T20:19:36.687791+00:00 app[web.1]: 25| }, function error(err) {

2017-10-17T20:19:36.687792+00:00 app[web.1]: listId is not defined

2017-10-17T20:19:36.687791+00:00 app[web.1]:

2017-10-17T20:19:36.687794+00:00 app[web.1]: at eval (eval at compile (/app/node_modules/ejs/lib/ejs.js:524:12), :22:26)

2017-10-17T20:19:36.687795+00:00 app[web.1]: at tryHandleCache (/app/node_modules/ejs/lib/ejs.js:203:34)

2017-10-17T20:19:36.687796+00:00 app[web.1]: at View.exports.renderFile [as engine] (/app/node_modules/ejs/lib/ejs.js:412:10)

2017-10-17T20:19:36.687795+00:00 app[web.1]: at returnedFn (/app/node_modules/ejs/lib/ejs.js:555:17)

2017-10-17T20:19:36.687797+00:00 app[web.1]: at View.render (/app/node_modules/express/lib/view.js:128:8)

2017-10-17T20:19:36.687797+00:00 app[web.1]: at tryRender (/app/node_modules/express/lib/application.js:640:10)

2017-10-17T20:19:36.687798+00:00 app[web.1]: at Function.render (/app/node_modules/express/lib/application.js:592:3)

2017-10-17T20:19:36.687799+00:00 app[web.1]: at ServerResponse.render (/app/node_modules/express/lib/response.js:966:7)

2017-10-17T20:19:36.687800+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)

2017-10-17T20:19:36.687799+00:00 app[web.1]: at /app/routes/index.js:15:7

2017-10-17T20:19:36.687800+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)

2017-10-17T20:19:36.687801+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)

2017-10-17T20:19:36.687801+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)

2017-10-17T20:19:36.687802+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:281:22

2017-10-17T20:19:36.687803+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)

2017-10-17T20:19:36.687803+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)

2017-10-17T20:19:36.682828+00:00 heroku[router]: at=info method=GET path="/" host=serene-bayou-29655.herokuapp.com request_id=8eacda4d-ea79-4857-83f2-f4f7dacbae97 fwd="78.19.206.245" dyno=web.1 connect=0ms service=3ms status=500 bytes=404 protocol=https

2017-10-17T20:19:51.726581+00:00 heroku[router]: at=info method=GET path="/" host=serene-bayou-29655.herokuapp.com request_id=c41578eb-d5cf-47e9-b18b-23f6f41b2702 fwd="78.19.206.245" dyno=web.1 connect=5ms service=9ms status=500 bytes=404 protocol=https

2017-10-17T20:19:51.722177+00:00 app[web.1]: GET / 500 0.522 ms - 148

2017-10-17T20:19:51.730470+00:00 app[web.1]: ReferenceError: /app/views/index.ejs:22

2017-10-17T20:19:51.730474+00:00 app[web.1]: 21| context.psid,

2017-10-17T20:19:51.730473+00:00 app[web.1]: 20| window.attachApp(

2017-10-17T20:19:51.730475+00:00 app[web.1]: >> 22| <%= listId %>,

2017-10-17T20:19:51.730475+00:00 app[web.1]: 23| "<%= socketAddress %>",

2017-10-17T20:19:51.730476+00:00 app[web.1]: 24| context.thread_type);

2017-10-17T20:19:51.730477+00:00 app[web.1]: 25| }, function error(err) {

2017-10-17T20:19:51.730478+00:00 app[web.1]: listId is not defined

2017-10-17T20:19:51.730477+00:00 app[web.1]:

2017-10-17T20:19:51.730480+00:00 app[web.1]: at eval (eval at compile (/app/node_modules/ejs/lib/ejs.js:524:12), :22:26) `