12 May 2023 09:12 AM - edited 12 May 2023 09:15 AM
exceljs (https://github.com/exceljs/exceljs) is working fine in local development app function (creating workbook, adding/editing worksheet, export as buffer).
When it is deployed, and this app function api is called from workflow, the following error message returned:
{"error":{"code":540,"message":"Execution crashed","details":{"logs":"","type":"UNCAUGHT_EXCEPTION","message":"Uncaught error"}}}
Created a separate app function to isolate and test the exceljs library, the similar error message returned as above.
Code block for reference:
import ExcelJS from "exceljs";
const workbook = new ExcelJS.Workbook();
export default async function (payload: unknown = undefined) {
return "Hello world";
}
What is the possible cause for the crashing message above? which it works well in local development but not in production.
Thank you.
Solved! Go to Solution.
12 May 2023 11:18 AM
Hi @william_cher, app functions can't have any node dependencies. Once deployed, they run in the Dynatrace JavaScript runtime, which has limited access to only a few APIs. You can read more about it in the developer portal. You can still use such dependencies in your app's React frontend though.
Feel free to also read more about app functions' use cases.