Hi,
I have a problem with latest Netlify serverless function deployed to Netlify. Basically, the function connects to database and executes a query. Data returned is used in Angular component. Locally it works, but in production data is not returned. I have added console.logs in client side and I see no data, so I assume that something is prevent query in the function to be executed.
This is the query:
prompts = await connection.execute(
`SELECT sentence, emotionName FROM Sentence ORDER BY sentenceID DESC LIMIT ${page}, ${perPage};`
);
Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading '0') TypeError: Cannot read properties of undefined (reading '0') at https://deploy-preview-22--color-healing.netlify.app/main.4beea88f24107e7a.js:1:589897 at v.invoke (https://deploy-preview-22--color-healing.netlify.app/polyfills.7f740e70b18aea79.js:1:6588) at Object.onInvoke (https://deploy-preview-22--color-healing.netlify.app/main.4beea88f24107e7a.js:1:108631) at v.invoke (https://deploy-preview-22--color-healing.netlify.app/polyfills.7f740e70b18aea79.js:1:6528) at M.run (https://deploy-preview-22--color-healing.netlify.app/polyfills.7f740e70b18aea79.js:1:1954) at https://deploy-preview-22--color-healing.netlify.app/polyfills.7f740e70b18aea79.js:1:16798 at v.invokeTask (https://deploy-preview-22--color-healing.netlify.app/polyfills.7f740e70b18aea79.js:1:7206) at Object.onInvokeTask (https://deploy-preview-22--color-healing.netlify.app/main.4beea88f24107e7a.js:1:108447) at v.invokeTask (https://deploy-preview-22--color-healing.netlify.app/polyfills.7f740e70b18aea79.js:1:7127) at M.runTask (https://deploy-preview-22--color-healing.netlify.app/polyfills.7f740e70b18aea79.js:1:2571)
Site url: https://color-healing.netlify.app/
Site preview: Color Healing
I was never in this kind of situation, and I don’t really know how to approach debugging of Netlify function in production.
Help appreciated.