Why am I getting an error 'Cannot access Data Store before initialization' when I try to insert a row into my table using the Node.js SDK?
You will encounter this error if you have not initialized the Catalyst Node.js SDK properly in your function. Use the following code to ensure you have initialized the Node.js SDK and Catalyst Data Store properly.
copy
const catalyst = require("zcatalyst-sdk-node");
const datastore = catalystApp.datastore(); //Initializing catalystApp variable differs with each function type
Updated
Yes
No
Send your feedback to us
Skip
Submit
Ask AI about this answer