I am sure this is obvious but I am at a loss for things to try. Can anyone give me a hint?
In backend/data.js I am trying to import from 3 modules
backend/ ucw-crm,
backend/ ucw-email,
backend/ ucw-utilities
backend/data.js
// data.js
//
// Robert Fontaine
// 2020-May-18
import wixData from 'wix-data';
import updateFreshSales from 'ucw-crm';
import sendEmail from 'ucw-email';
import titleCase from 'ucw-utilities';
In the site monitor I am getting the error:
"["Failed to load wix data hooks: Cannot find module ‘ucw-crm’\n
Require stack:\n
- backend/data.js\n
- stubmodule-that-does-the-require.js\n
- node_modules/scoped-require/index.js
n- create-app.js\n
- cloud-grid-runner.js"]"
I changed all the file names and import statements and now it is complaining about not finding a file that isn’t there and isn’t asked for. Something in WIXland is seriously out of synch on the server.
Tried contacting support… wut a joke. after an hour I got a call back from a nice young woman… who then put me on hold for an hour to talk to another nice young woman… neither of which knew anything about WIX and the second one then created a support ticket which will almost assuredly not ask the right questions of the tech. I should have just written an email… But the last time I did they didn’t respond.
I here their stock is doing well though.
Sigh.
First of all, please take note of our forum guidelines .
Also, note that Wix Support does not deal with code related issues, that is what this Wix Corvid Forum is for, so no point trying to moan about them when they can’t help and would have referred you to here instead.
I would thoroughly suggest that you spend more time reading about using datahooks in Wix Code and calling backend code etc.
You can find out more about Datahooks and Data.js backend file here.
https://www.wix.com/corvid/reference/wix-data.Hooks.html
https://www.wix.com/corvid/forum/tips-tutorials-examples/example-no-database-duplicates
https://support.wix.com/en/article/corvid-about-data-hooks
https://support.wix.com/en/article/corvid-using-data-hooks
You can find out more about calling backend code here.
https://support.wix.com/en/article/corvid-web-modules-calling-server-side-code-from-the-front-end
https://support.wix.com/en/article/corvid-accessing-third-party-services-with-the-fetch-api
So any imports from the backend should look like this from the example.
import {sendEmail} from'backend/sendEmail.jsw';
import {getCurrentTemp} from'backend/serviceModule';
Also, as you are using sendEmail, you can find this tutorial here all about sending a email on form submission, if you have not already seen and used it.
https://support.wix.com/en/article/corvid-tutorial-sending-an-email-on-form-submission
GOS, firstly, your Guidelines link is broken. Secondly, I don’t think it is unreasonable to be annoyed with a 2 hour support call, if what you are saying is correct then they should have referred OP in the first instance instad of wasting 2 hours of their time…
You do realize that this thread is from six months ago?
Understand that this forum is not a support site. It is a community of Corvid developers and users where coding and development topics are discussed and information shared. There is no assurance that users will find their answers here. A certain level of competence is expected when asking questions here on the forum. For that, Wix provides many resources to help users learn how to get the most out of Corvid. We encourage users to take advantage of these resources which include video tutorials, full app examples (which can be loaded into the user’s editor), API documentation, and a wealth of articles describing a wide range of topics - from beginner to advanced. For those users who need coding assistance, it is possible to find expert developers on the Wix Marketplace an online marketplace with top Corvid web developers from around the world.