Yes, when I first set it up, it populated it with 10 rows, which I specified (10) in the âMax Historical Recordsâ Field, so it pulled in those more or less straight away, however since then no more rows of events have been added, despite blockchain events happening.
Try to disable that beforeSave to see if it works
Do you mean the:
Moralis.Cloud.beforeSave(âAuctionCreatedâ, async (request) =>{
That is in the Cloud functions?
Yes, that one, or you could add more logging
Iâve removed everything from cloud functions, will see if that makes a difference
What would more logging be?
Like a logger.info in the first line of that function
OK, it looks like it updates the database now.
However I have now lost the cloud functions console screen on the âCloud Functionsâ tab even though the CLI says: Changes Uploaded Correctly
the server has cloud code now, you say that you donât see it in admin interface?
Ok, we will check why it is not showing now
cloud code works now again
OK great thanks.
Also sorry to keep at this, if beforeSave causes the sync to have issues with updating the data table, as weâve discovered by removing it:
Moralis.Cloud.beforeSave(âAuctionCreatedâ, async (request) =>{
Note: this is used in the Moralis tutorial video (time 6:03) and appears to work on there:
What should be used instead?
you should make it work without errors, now it has errors on executions and when beforeSave fails there is no data saved
you can use afterSave as an alternative
Thanks
Iâm getting a bunch of
Error: Invalid function: âpluginsReadyâ
I donât have any plugins, so iâm not sure what that means:
2022-09-01T20:46:59.132Z - Error: Invalid function: âpluginsReadyâ
at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:201:13)
at /moralis-server/lib/PromiseRouter.js:85:20
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-09-01T20:46:04.029Z - Error: Invalid function: âpluginsReadyâ
at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:201:13)
at /moralis-server/lib/PromiseRouter.js:85:20
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-09-01T19:03:37.699Z - Error: Invalid function: âpluginsReadyâ
at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:201:13)
at /moralis-server/lib/PromiseRouter.js:85:20
at processTicksAndRejections (node:internal/process/task_queues:96:5)
You will see those errors usually when the server restarts
Thanks for your patience.
I have these errors:
afterSave failed for AuctionCreated for user:
Error: {
âmessageâ: âdata is not definedâ,
âcodeâ: 141
}
Does that mean I need to add those as columns in the database table?
Can you post your afterSave
code? Check your use of data
, make sure that variable exists.
Iâve just made a new post, it doesnât really belong to this one anymore:
Code included in that