Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Infer programming model when the export is an express app #225

Open
gunar opened this issue Sep 13, 2018 · 0 comments
Open

Infer programming model when the export is an express app #225

gunar opened this issue Sep 13, 2018 · 0 comments

Comments

@gunar
Copy link

gunar commented Sep 13, 2018

Me and others have been bitten by the mysterious error message below. Solution is to either specify --meta wt-compiler=webtask-tools/express or use webtask-tools. This is probably such a common mistake that wt-cli could infer and apply the correct programming model automatically, or at least present a better error message.

I understand that the way webtasks are currently implemented, this would have to occur at compile time and statically analyzing JavaScript is too complex. I don't have the answer for you.

Just putting it out there that this is a UX problem.

{
  "code": 500,
  "error": "Script generated an unhandled synchronous exception.",
  "details": "TypeError: fn.apply is not a function",
  "name": "TypeError",
  "message": "fn.apply is not a function",
  "stack": "TypeError: fn.apply is not a function\n    at /data/_verquire/express/4.16.3/node_modules/express/lib/router/index.js:635:15\n    at next (/data/_verquire/express/4.16.3/node_modules/express/lib/router/index.js:210:14)\n    at Function.handle (/data/_verquire/express/4.16.3/node_modules/express/lib/router/index.js:174:3)\n    at Function.handle (/data/_verquire/express/4.16.3/node_modules/express/lib/application.js:174:10)\n    at app (/data/_verquire/express/4.16.3/node_modules/express/lib/express.js:39:9)\n    at Async.waterfall (/data/sandbox/lib/sandbox.js:542:33)\n    at nextTask (/data/sandbox/node_modules/async/dist/async.js:5324:14)\n    at next (/data/sandbox/node_modules/async/dist/async.js:5331:9)\n    at /data/sandbox/node_modules/async/dist/async.js:969:16\n    at Async.waterfall (/data/sandbox/lib/sandbox.js:431:24)"
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants