question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting error "Supplied code must return or export a function." on new deployments

See original GitHub issue

Team, I recently started getting the error in runtime

{
  "code": 400,
  "message": "Invalid webtask code",
  "error": "Supplied code must return or export a function."
}

when I invoke the webtask. The webtask duly has the structure

const webtaskApi = module.webtask;
module.exports = function(e) {
}

What could be wrong?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
baskincommented, Sep 21, 2018

Thanks a bunch!!

0reactions
NotMyselfcommented, Sep 21, 2018

@baskin

This issue should now be resolved with the release of wt-cli v11.0.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot deployment issues in Lambda
Deployment errors prevent the new version from being used and can arise from issues with your deployment package, code, permissions, or tools.
Read more >
Troubleshoot common Azure deployment errors
Error code Mitigation More inform... AccountNameInvalid Follow naming guidelines for storage accounts. Resolve erro... AccountPropertyCannotBeSet Check available storage account properties. storageAcco... AnotherOperationInProgress Wait for concurrent operation...
Read more >
Troubleshooting Cloud Functions - Google Cloud
Cloud Functions deployment can fail if the entry point to your code, that is, the exported function name, is not specified correctly. The...
Read more >
Errors – Vercel Docs
A list of errors provided by Vercel CLI or the REST API, with details on how they occur and how to resolve them....
Read more >
Getting Unexpected Token Export - javascript - Stack Overflow
there is not enough information about your environment or configuration to offer any assistance. This error is suggesting that either webpack or babel...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found