I have created pre registration hook and called out internal api to validate user but Its not allowing to create user after api successfully validated.
The following is the network call from browser developer tool
error:
"code": 400,
"error": "Script returned an error.",
"details": "Error: No function found. Make sure you export it using \"module.exports = async function(event, context) { }\"",
"name": "Error",
"message": "No function found. Make sure you export it using \"module.exports = async function(event, context) { }\"",
"stack": "Error: No function found. Make sure you export it using \"module.exports = async function(event, context) { }\"\n at module.exports (/data/io/node12/7d13bcb6-24dc-4a4a-b8dc-b5a17c66fe13/webtask.js:159:7)\n at v1WebtaskWrapper (/data/io/65321e3f93af0d589dc791c85863346264b58e5d.js:121:16)\n at Async.waterfall.Errors.create.code (/data/sandbox/lib/sandbox.js:617:25)\n at nextTask (/data/sandbox/node12/node_modules/async/dist/async.js:5324:14)\n at next (/data/sandbox/node12/node_modules/async/dist/async.js:5331:9)\n at /data/sandbox/node12/node_modules/async/dist/async.js:969:16\n at /data/sandbox/lib/sandbox.js:496:22\n at /data/sandbox/lib/sandbox.js:704:16\n at invokeCallback (/data/sandbox/node12/node_modules/raw-body/index.js:224:16)\n at done (/data/sandbox/node12/node_modules/raw-body/index.js:213:7)"
if we make change the function as in error says its working
module.exports = async (event, api)
If I try to recreate, I get an error when using module.exports, and everything is fine with the standard exports.onExecutePreUserRegistration. Are you getting the error if you use the test functionality in the editor, or in the log if you have a use sign up?