• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Issue running PDF SDK with Typescript on AWS Lambda functions

New Here ,
Aug 24, 2023 Aug 24, 2023

Copy link to clipboard

Copied

I am running my app on Lambda function to generate PDF from Word document, however the code is not even starting, when called it goes trait with the following message:

| Error: allowedConfiguration is not defined

       at ../../../node_modules/.pnpm/@adobe+pdfservices-node-sdk@3.4.2/node_modules/@adobe/pdfservices-node-sdk/src/operation/export-pdf-to-images-operation.js (/Users/rdinis/IdeaProjects/mpi/trade-certification-main/node_modules/.pnpm/@adobe+pdfservices-node-sdk@3.4.2/node_modules/@adobe/pdfservices-node-sdk/src/operation/export-pdf-to-images-operation.js:77:1)

       at __require2 (file:///Users/rdinis/IdeaProjects/mpi/trade-certification-main/backend/service/pdf-generation/.sst/artifacts/c8bb0bcd321ec6f63b0c0aa4f72c285df9e6710a1a/src/functions/resolver.mjs:24:50)

       at ../../../node_modules/.pnpm/@adobe+pdfservices-node-sdk@3.4.2/node_modules/@adobe/pdfservices-node-sdk/src/pdfservices-sdk.js (/Users/rdinis/IdeaProjects/mpi/trade-certification-main/node_modules/.pnpm/@adobe+pdfservices-node-sdk@3.4.2/node_modules/@adobe/pdfservices-node-sdk/src/pdfservices-sdk.js:24:31)

       at __require2 (file:///Users/rdinis/IdeaProjects/mpi/trade-certification-main/backend/service/pdf-generation/.sst/artifacts/c8bb0bcd321ec6f63b0c0aa4f72c285df9e6710a1a/src/functions/resolver.mjs:24:50)

       at <anonymous> (/Users/rdinis/IdeaProjects/mpi/trade-certification-main/backend/service/pdf-generation/src/functions/createPDFFromTemplate.ts:1:69)

       at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

Can anyone explain that?

Views

519

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 25, 2023 Aug 25, 2023

Copy link to clipboard

Copied

I know our SDK runs on Lambda - can you try _not_ using a TypeScript file, just to help minimize the issues? Also, since your using Node, you can easily use our REST APIs instead of the SDK. I even have a library (https://github.com/cfjedimaster/document-services-demos/tree/main/serviceswrapper) you could use to get you most of the way there.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 10, 2023 Nov 10, 2023

Copy link to clipboard

Copied

Seeing the same issue here in NextJs (node) environment. It's due to the allowedConfiguration object not being defined correctly in multiple files under src/operation/. I don't think saying "don't use the SDK" is really an answer, it's a pretty easy fix.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 10, 2023 Nov 10, 2023

Copy link to clipboard

Copied

Well, we don't specify support for TypeScript -but it you want to give me an exact report of what fails, I could report it internally. Officially, you would need to use JavaScript though. 

 

Me saying 'dont use the SDK' was simply trying to give you an alternative to quickly get going again. Personally I've stopped using our SDKs since the REST APIs are so simple. I *know* that would work in a TypeScript environment.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 05, 2024 Mar 05, 2024

Copy link to clipboard

Copied

LATEST

@Duncan_LHS Can you share the fix please? Im having the same issue now and this is the only google result 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources