I’m having trouble with
Backend code failing due to a “Cannot find module ‘wix-crm’” error, which prevents my triggered emails from sending.
Working in
Wix Editor with Velo Dev Mode, using backend functions.
Site link
https://www.yaps.co.za/yaps-golf-day
What I’m trying to do
I have a form on my “YAPS Golf Day” page. Upon submission, I want to save the form data to a CMS collection and then send two triggered emails: a confirmation to the user and a notification to the site admin. My email sending logic is contained in a backend function (automationTriggers.jsw).
What I’ve tried so far
I have implemented the code suggested by Wix’s support team, which uses wix-crm.contacts.appendOrCreateContact() and wix-crm-backend.triggeredEmails.emailContact() to handle the email automation. I have saved and published the site after making these changes.
Despite using the correct API calls, the backend function consistently fails with a "Cannot find module 'wix-crm'" error. This is preventing the function from even starting, leading to a "Backend failed to send emails: undefined" error on the frontend. The wix-crm module is a core Wix API, and the error indicates that the module is not being loaded by the server environment for my site.
Extra context
This appears to be a platform-level issue, as the code itself is a direct implementation of the recommended solution. The environment on my site seems to be broken and is not making the built-in wix-crm module available to my backend Velo code. I am unable to proceed with my form’s email functionality until this module loading issue is resolved on Wix’s end.
These are the specific errors that I am receiving
Error 1:
Frontend failed to call backend email sending function: ModuleNotFoundError: Error: Unable to handle the request. Contact the site administrator or view site monitoring logs for more information.
{
“insertId”: “…QYXyHRJE_4oQb9xOP6Sadn”,
“timestamp”: “2025-08-01T08:02:07.573Z”,
“labels”: {
"siteUrl": "https://www.yaps.co.za",
"revision": "810",
"namespace": "Velo",
"tenantId": "c13a1223-169d-4a36-8b5b-b041f6eac85d",
"viewMode": "Site",
"pageName": "YAPS Golf Day"
},
“sourceLocation”: {
"file": "pages/YAPS Golf Day.q1l4n.js"
},
“operation”: {
"id": "..........Q4gPsINGl5w9uUfapfzvxr",
"producer": "https://www.yaps.co.za"
},
“jsonPayload”: {
"message": "ERROR: Frontend failed to call backend email sending function: ModuleNotFoundError: Error: Unable to handle the request. Contact the site administrator or view site monitoring logs for more information."
},
“severity”: “ERROR”,
“receiveTimestamp”: “2025-08-01T08:02:08.368Z”,
“id”: “ce60b967-9590-472c-a7aa-1213cfb86ea7”
}
Error 2:
Error loading web module backend/automationTriggers.jsw: Cannot find module ‘wix-crm’
Require stack:
-
/user-code/backend/automationTriggers.jsw
-
/user-code/stubmodule-that-does-the-require.js
-
/cloud-runtime-code/node_modules/scoped-require/index.js
-
/cloud-runtime-code/packages/elementory/cloud-runtime/factories.js
-
/cloud-runtime-code/packages/elementory/cloud-runtime/create-app.js
-
/cloud-runtime-code/packages/elementory/cloud-runtime/cloud-grid-runner.js
{
“insertId”: “…6tLOCv3V47zsQeik9Ciyhh”,
“timestamp”: “2025-08-01T08:02:07.868Z”,
“labels”: {
"siteUrl": "https://www.yaps.co.za",
"revision": "810",
"namespace": "Velo",
"tenantId": "c13a1223-169d-4a36-8b5b-b041f6eac85d",
"viewMode": "Site"
},
“sourceLocation”: {
"file": "backend/automationTriggers.jsw",
"line": 4,
"column": 1
},
“operation”: {
"id": "1754035327.426826736503153161898",
"producer": "backend"
},
“jsonPayload”: {
"message": "Error loading web module backend/automationTriggers.jsw: Cannot find module 'wix-crm'\nRequire stack:\n- /user-code/backend/automationTriggers.jsw\n- /user-code/stubmodule-that-does-the-require.js\n- /cloud-runtime-code/node_modules/scoped-require/index.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/factories.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/create-app.js\n- /cloud-runtime-code/packages/elementory/cloud-runtime/cloud-grid-runner.js"
},
“severity”: “ERROR”,
“receiveTimestamp”: “2025-08-01T08:02:08.155Z”,
“id”: “d2ee40b6-d286-497b-9ca3-c62db98682ad”
}