Is it Possible to Send an Image to an API Directly from Google Drive or Does It Require Storage in /tmp First for PipeDream to Facilitiate the Process?

This topic was automatically generated from Slack. You can find the original thread here.

Can I send an image to an API directly from my Google Drive, or does it need to be stored in /tmp first in order for PipeDream to call the API and send the image over?

Yes, you can send an image to an API directly from your Google Drive. You can use the Google Drive API to get the image file and then send it to the desired API. Here’s an example Pipedream component that demonstrates how to do this: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { google: { type: "app", app: "google", }, fileId: { type: "string", label: "File ID", description: "The ID of the image file in your Google Drive", }, }, async run({ steps, $ }) { // Get the image file from Google Drive const response = await axios($, { url: `https://www.googleapis.com/drive/v3/files/${this.fileId}?alt=media`, headers: { Authorization: `Bearer ${this.google.$auth.oauth_access_token}`, }, responseType: "arraybuffer", }); // Send the image to the desired API // Replace the URL and headers with the appropriate values for the target API const targetApiUrl = "https://example.com/api/upload"; const targetApiHeaders = { "Content-Type": "image/jpeg", "Authorization": "Bearer your_target_api_token", }; return await axios($, { method: "POST", url: targetApiUrl, headers: targetApiHeaders, data: response.data, }); }, }); Replace the targetApiUrl and targetApiHeaders with the appropriate values for the API you want to send the image to.

here is the API I am trying to send to. Can you please write me the code that will pull from Google Drive and send to this API?

Developer Platform
Sandbox
Documentation
Pricing

Login

import fetch from 'node-fetch';
import FormData from 'form-data';
import fs from 'node:fs';

// NOTE: This example is using a NodeJS FormData library.
// Browsers should use their native FormData class.
// React Native apps should also use their native FormData class.
const formData = new FormData();
formData.append('image', fs.readFileSync('../init_image.png'));
formData.append("height", 0);

const response = await fetch(
  "

https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale

",
  {
    method: 'POST',
    headers: {
      ...formData.getHeaders(),
      Accept: 'application/json',
      Authorization: "Bearer YOUR_API_KEY",
    },
    body: formData,
  }
);

if (!response.ok) {
  throw new Error(`Non-200 response: ${await response.text()}`)
}

const responseJSON = await response.json();

responseJSON.artifacts.forEach((image, index) => {
  fs.writeFileSync(
    `./out/img2img_${image.seed}.png`,
    Buffer.from(image.base64, 'base64')
  )
});

To send an image from your Google Drive to the Stability.ai API, you can use the following Pipedream component: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { google: { type: "app", app: "google", }, fileId: { type: "string", label: "File ID", description: "The ID of the image file in your Google Drive", }, stabilityApiKey: { type: "string", label: "[Stability.ai](http://Stability.ai) API Key", description: "Your [Stability.ai](http://Stability.ai) API key", }, }, async run({ $ }) { // Get the image file from Google Drive const response = await axios($, { url: `https://www.googleapis.com/drive/v3/files/${this.fileId}?alt=media`, headers: { Authorization: `Bearer ${this.google.$auth.oauth_access_token}`, }, responseType: "arraybuffer", }); // Create FormData for [Stability.ai](http://Stability.ai) API const formData = new FormData(); formData.append("image", response.data, "image.png"); formData.append("height", 0); // Send the image to the [Stability.ai](http://Stability.ai) API const stabilityApiUrl = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale"; return await axios($, { method: "POST", url: stabilityApiUrl, headers: { ...formData.getHeaders(), Accept: "application/json", Authorization: `Bearer ${this.stabilityApiKey}`, }, data: formData, }); }, }); Replace YOUR_API_KEY with your actual Stability.ai API key. This component will fetch the image from your Google Drive using the provided fileId and send it to the Stability.ai API for processing.

TypeError
Failed to execute ‘append’ on ‘FormData’: parameter 2 is not of type ‘Blob’
DETAILS

    at FormData.append (node:internal/deps/undici/undici:6113:17)
    at Object.run (file:///tmp/__pdg__/dist/code/f4ad3783a0d2fb2f8175b7b9d83b25850c66bb70b7af8f0c9c3c580c760ac227/component.mjs:32:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at null.executeComponent (/var/task/launch_worker.js:229:22)
    at MessagePort.messageHandler (/var/task/launch_worker.js:726:28)

I apologize for the error in the code. It seems that the FormData append method is causing an issue. Let’s try a different approach using the Buffer class to send the image data. Here’s the updated code: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { google: { type: "app", app: "google", }, fileId: { type: "string", label: "File ID", description: "The ID of the image file in your Google Drive", }, stabilityApiKey: { type: "string", label: "[Stability.ai](http://Stability.ai) API Key", description: "Your [Stability.ai](http://Stability.ai) API key", }, }, async run({ $ }) { // Get the image file from Google Drive const response = await axios($, { url: `https://www.googleapis.com/drive/v3/files/${this.fileId}?alt=media`, headers: { Authorization: `Bearer ${this.google.$auth.oauth_access_token}`, }, responseType: "arraybuffer", }); // Create FormData for [Stability.ai](http://Stability.ai) API const formData = new FormData(); formData.append("image", new Blob([new Uint8Array(response.data)]), "image.png"); formData.append("height", 0); // Send the image to the [Stability.ai](http://Stability.ai) API const stabilityApiUrl = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale"; return await axios($, { method: "POST", url: stabilityApiUrl, headers: { ...formData.getHeaders(), Accept: "application/json", Authorization: `Bearer ${this.stabilityApiKey}`, }, data: formData, }); }, }); This code uses the Buffer class to create a Blob from the ArrayBuffer response data, which should resolve the issue with the FormData append method.

TypeError
formData.getHeaders is not a function
DETAILS

    at Object.run (file:///tmp/__pdg__/dist/code/d936fadbd6ad3294ac8dd6fdd48d2bedd1ceadc4112a7c30eaa4e4c31bd8db83/component.mjs:43:21)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at null.executeComponent (/var/task/launch_worker.js:229:22)
    at MessagePort.messageHandler (/var/task/launch_worker.js:726:28)

I apologize for the confusion. It seems that the getHeaders() method is not available for the FormData instance. Let’s try using the form-data package instead. Here’s the updated code: import { axios } from "@pipedream/platform"; import FormData from "form-data"; export default defineComponent({ props: { google: { type: "app", app: "google", }, fileId: { type: "string", label: "File ID", description: "The ID of the image file in your Google Drive", }, stabilityApiKey: { type: "string", label: "[Stability.ai](http://Stability.ai) API Key", description: "Your [Stability.ai](http://Stability.ai) API key", }, }, async run({ $ }) { // Get the image file from Google Drive const response = await axios($, { url: `https://www.googleapis.com/drive/v3/files/${this.fileId}?alt=media`, headers: { Authorization: `Bearer ${this.google.$auth.oauth_access_token}`, }, responseType: "arraybuffer", }); // Create FormData for [Stability.ai](http://Stability.ai) API const formData = new FormData(); formData.append("image", new Blob([new Uint8Array(response.data)]), "image.png"); formData.append("height", 0); // Send the image to the [Stability.ai](http://Stability.ai) API const stabilityApiUrl = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale"; return await axios($, { method: "POST", url: stabilityApiUrl, headers: { ...formData.getHeaders(), Accept: "application/json", Authorization: `Bearer ${this.stabilityApiKey}`, }, data: formData, }); }, }); This code imports the form-data package and uses it to create a FormData instance. The getHeaders() method should now be available, and the issue should be resolved.

“TypeError Failed to execute ‘append’ on ‘FormData’: parameter 2 is not of type ‘Blob’ DETAILS at FormData.append (node:internal/deps/undici/undici:6113:17) at Object.run (file:///tmp/pdg/dist/code/f4ad3783a0d2fb2f8175b7b9d83b25850c66bb70b7af8f0c9c3c580c760ac227/component.mjs:32:14) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at null.executeComponent (/var/task/launch_worker.js:229:22) at MessagePort.messageHandler (/var/task/launch_worker.js:726:28)”
auto-generated
2 minutes ago

TypeError
source.on is not a function
DETAILS

    at Function.DelayedStream.create (/tmp/__pdg__/dist/code/6ca35c9c7faf46d78e19da4044207bbb22b3252400dd130ff5a18bead8889816/node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js:33:10)
    at FormData.CombinedStream.append (/tmp/__pdg__/dist/code/6ca35c9c7faf46d78e19da4044207bbb22b3252400dd130ff5a18bead8889816/node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js:45:37)
    at FormData.FormData.append (/tmp/__pdg__/dist/code/6ca35c9c7faf46d78e19da4044207bbb22b3252400dd130ff5a18bead8889816/node_modules/.pnpm/form-data@4.0.0/node_modules/form-data/lib/form_data.js:75:3)
    at Object.run (file:///tmp/__pdg__/dist/code/6ca35c9c7faf46d78e19da4044207bbb22b3252400dd130ff5a18bead8889816/component.mjs:33:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at null.executeComponent (/var/task/launch_worker.js:229:22)
    at MessagePort.messageHandler (/var/task/launch_worker.js:726:28)

“TypeError Failed to execute ‘append’ on ‘FormData’: parameter 2 is not of type ‘Blob’ DETAILS at FormData.append (node:internal/deps/undici/undici:6113:17) at Object.run (file:///tmp/pdg/dist/code/f4ad3783a0d2fb2f8175b7b9d83b25850c66bb70b7af8f0c9c3c580c760ac227/component.mjs:32:14) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at null.executeComponent (/var/task/launch_worker.js:229:22) at MessagePort.messageHandler (/var/task/launch_worker.js:726:28)”
auto-generated
2 minutes ago

TypeError
source.on is not a function
DETAILS

    at Function.DelayedStream.create (/tmp/__pdg__/dist/code/6ca35c9c7faf46d78e19da4044207bbb22b3252400dd130ff5a18bead8889816/node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js:33:10)
    at FormData.CombinedStream.append (/tmp/__pdg__/dist/code/6ca35c9c7faf46d78e19da4044207bbb22b3252400dd130ff5a18bead8889816/node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js:45:37)
    at FormData.FormData.append (/tmp/__pdg__/dist/code/6ca35c9c7faf46d78e19da4044207bbb22b3252400dd130ff5a18bead8889816/node_modules/.pnpm/form-data@4.0.0/node_modules/form-data/lib/form_data.js:75:3)
    at Object.run (file:///tmp/__pdg__/dist/code/6ca35c9c7faf46d78e19da4044207bbb22b3252400dd130ff5a18bead8889816/component.mjs:33:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at null.executeComponent (/var/task/launch_worker.js:229:22)
    at MessagePort.messageHandler (/var/task/launch_worker.js:726:28)

I’m sorry you’re experiencing this issue. It seems like you’re trying to append a non-Blob type value to FormData. To help you further, I’ll need more information about your code and what you’re trying to achieve. Can you please provide more context or share the relevant part of your code?

import { axios } from "@pipedream/platform";
import FormData from "form-data";

export default defineComponent({
  props: {
    google: {
      type: "app",
      app: "google",
    },
    fileId: {
      type: "string",
      label: "File ID",
      description: "The ID of the image file in your Google Drive",
    },
    stabilityApiKey: {
      type: "string",
      label: "[Stability.ai](http://Stability.ai) API Key",
      description: "Your [Stability.ai](http://Stability.ai) API key",
    },
  },
  async run({ $ }) {
    // Get the image file from Google Drive
    const response = await axios($, {
      url: `https://www.googleapis.com/drive/v3/files/${this.fileId}?alt=media`,
      headers: {
        Authorization: `Bearer ${this.google.$auth.oauth_access_token}`,
      },
      responseType: "arraybuffer",
    });

    // Create FormData for [Stability.ai](http://Stability.ai) API
    const formData = new FormData();
    formData.append("image", new Blob([new Uint8Array(response.data)]), "image.png");
    formData.append("height", 0);

    // Send the image to the [Stability.ai](http://Stability.ai) API
    const stabilityApiUrl =
      "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale";

    return await axios($, {
      method: "POST",
      url: stabilityApiUrl,
      headers: {
        ...formData.getHeaders(),
        Accept: "application/json",
        Authorization: `Bearer ${this.stabilityApiKey}`,
      },
      data: formData,
    });
  },
});

It looks like you’re trying to fetch an image file from Google Drive and then send it to the Stability.ai API using FormData. The issue seems to be related to appending a non-Blob type value to FormData. To fix this issue, you can create a Blob from the response data using the correct MIME type. You can update the code as follows: import { axios } from "@pipedream/platform"; import FormData from "form-data"; export default defineComponent({ props: { google: { type: "app", app: "google", }, fileId: { type: "string", label: "File ID", description: "The ID of the image file in your Google Drive", }, stabilityApiKey: { type: "string", label: "[Stability.ai](http://Stability.ai) API Key", description: "Your [Stability.ai](http://Stability.ai) API key", }, }, async run({ $ }) { // Get the image file from Google Drive const response = await axios($, { url: `https://www.googleapis.com/drive/v3/files/${this.fileId}?alt=media`, headers: { Authorization: `Bearer ${this.google.$auth.oauth_access_token}`, }, responseType: "arraybuffer", }); // Create FormData for [Stability.ai](http://Stability.ai) API const formData = new FormData(); formData.append("image", new Blob([response.data], { type: "image/png" }), "image.png"); formData.append("height", 0); // Send the image to the [Stability.ai](http://Stability.ai) API const stabilityApiUrl = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale"; return await axios($, { method: "POST", url: stabilityApiUrl, headers: { ...formData.getHeaders(), Accept: "application/json", Authorization: `Bearer ${this.stabilityApiKey}`, }, data: formData, }); }, }); I’ve updated the Blob creation to include the MIME type { type: "image/png" }. This should resolve the issue with FormData.

TypeError
source.on is not a function
DETAILS

    at Function.DelayedStream.create (/tmp/__pdg__/dist/code/17560012c3fcf17e2b794a80aa04cef2798cd5672373fb884e7b09e07dfc4fca/node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js:33:10)
    at FormData.CombinedStream.append (/tmp/__pdg__/dist/code/17560012c3fcf17e2b794a80aa04cef2798cd5672373fb884e7b09e07dfc4fca/node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js:45:37)
    at FormData.FormData.append (/tmp/__pdg__/dist/code/17560012c3fcf17e2b794a80aa04cef2798cd5672373fb884e7b09e07dfc4fca/node_modules/.pnpm/form-data@4.0.0/node_modules/form-data/lib/form_data.js:75:3)
    at Object.run (file:///tmp/__pdg__/dist/code/17560012c3fcf17e2b794a80aa04cef2798cd5672373fb884e7b09e07dfc4fca/component.mjs:33:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at null.executeComponent (/var/task/launch_worker.js:229:22)
    at MessagePort.messageHandler (/var/task/launch_worker.js:726:28)

I apologize for the inconvenience. It seems the previous solution didn’t work as expected. Let’s try an alternative approach using Buffer instead of Blob. Please update your code as follows: import { axios } from "@pipedream/platform"; import FormData from "form-data"; export default defineComponent({ props: { google: { type: "app", app: "google", }, fileId: { type: "string", label: "File ID", description: "The ID of the image file in your Google Drive", }, stabilityApiKey: { type: "string", label: "[Stability.ai](http://Stability.ai) API Key", description: "Your [Stability.ai](http://Stability.ai) API key", }, }, async run({ $ }) { // Get the image file from Google Drive const response = await axios($, { url: `https://www.googleapis.com/drive/v3/files/${this.fileId}?alt=media`, headers: { Authorization: `Bearer ${this.google.$auth.oauth_access_token}`, }, responseType: "arraybuffer", }); // Create FormData for [Stability.ai](http://Stability.ai) API const formData = new FormData(); formData.append("image", Buffer.from(response.data), "image.png"); formData.append("height", 0); // Send the image to the [Stability.ai](http://Stability.ai) API const stabilityApiUrl = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale>"; return await axios($, { method: "POST", url: stabilityApiUrl, headers: { ...formData.getHeaders(), Accept: "application/json", Authorization: `Bearer ${this.stabilityApiKey}`, }, data: formData, }); }, }); In this solution, I replaced the Blob with Buffer.from(response.data) to create a buffer from the response data. This should resolve the issue with FormData.

TypeError
The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
DETAILS

    at null.__node_internal_captureLargerStackTrace (node:internal/errors:490:5)
    at null.NodeError (node:internal/errors:399:5)
    at Function.from (node:buffer:339:9)
    at Object.run (file:///tmp/__pdg__/dist/code/a5ebe5826bf76e542a0bdb28b95007d988b95181ad897925033c6248f3c96cdc/component.mjs:33:37)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at null.executeComponent (/var/task/launch_worker.js:229:22)
    at MessagePort.messageHandler (/var/task/launch_worker.js:726:28)

I apologize for the issue you’re experiencing. It seems there’s a problem with the response data when creating the buffer. Let’s add a check to ensure the response data is not undefined before creating the buffer. Please update your code as follows: import { axios } from "@pipedream/platform"; import FormData from "form-data"; export default defineComponent({ props: { google: { type: "app", app: "google", }, fileId: { type: "string", label: "File ID", description: "The ID of the image file in your Google Drive", }, stabilityApiKey: { type: "string", label: "[Stability.ai](http://Stability.ai) API Key", description: "Your [Stability.ai](http://Stability.ai) API key", }, }, async run({ $ }) { // Get the image file from Google Drive const response = await axios($, { url: `https://www.googleapis.com/drive/v3/files/${this.fileId}?alt=media`, headers: { Authorization: `Bearer ${this.google.$auth.oauth_access_token}`, }, responseType: "arraybuffer", }); if (response.data) { // Create FormData for [Stability.ai](http://Stability.ai) API const formData = new FormData(); formData.append("image", Buffer.from(response.data), "image.png"); formData.append("height", 0); // Send the image to the [Stability.ai](http://Stability.ai) API const stabilityApiUrl = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale"; return await axios($, { method: "POST", url: stabilityApiUrl, headers: { ...formData.getHeaders(), Accept: "application/json", Authorization: `Bearer ${this.stabilityApiKey}`, }, data: formData, }); } else { throw new Error("The response data is undefined. Please check the file ID and try again."); } }, }); This code checks if response.data is not undefined before creating the buffer and sending it to the Stability.ai API. If the data is undefined, it will throw an error with a message to check the file ID.

Error - Request failed with status code 404
{“type”:“Buffer”,“data”:[123,10,32,32,34,101,114,114,111,114,34,58,32,123,10,32,32,32,32,34,99,111,100,101,34,58,32,52,48,52,44,10,32,32,32,32,34,109,101,115,115,97,103,101,34,58,32,34,70,105,108,101,32,110,111,116,32,102,111,117,110,100,58,32,50,85,114,69,103,49,114,106,107,103,86,103,102,121,84,53,53,103,114,104,48,114,111,115,107,54,83,46,34,44,10,32,32,32,32,34,101,114,114,111,114,115,34,58,32,91,10,32,32,32,32,32,32,123,10,32,32,32,32,32,32,32,32,34,109,101,115,115,97,103,101,34,58,32,34,70,105,108,101,32,110,111,116,32,102,111,117,110,100,58,32,50,85,114,69,103,49,114,106,107,103,86,103,102,121,84,53,53,103,114,104,48,114,111,115,107,54,83,46,34,44,10,32,32,32,32,32,32,32,32,34,100,111,109,97,105,110,34,58,32,34,103,108,111,98,97,108,34,44,10,32,32,32,32,32,32,32,32,34,114,101,97,115,111,110,34,58,32,34,110,111,116,70,111,117,110,100,34,44,10,32,32,32,32,32,32,32,32,34,108,111,99,97,116,105,111,110,34,58,32,34,102,105,108,101,73,100,34,44,10,32,32,32,32,32,32,32,32,34,108,111,99,97,116,105,111,110,84,121,112,101,34,58,32,34,112,97,114,97,109,101,116,101,114,34,10,32,32,32,32,32,32,125,10,32,32,32,32,93,10,32,32,125,10,125,10]}
DETAILS

    at null.createError (/tmp/__pdg__/dist/code/33169ea97e0f3858dcfe135892a94144be15e4ae43277b45d9b89296fd777032/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/core/createError.js:16:15)
    at null.settle (/tmp/__pdg__/dist/code/33169ea97e0f3858dcfe135892a94144be15e4ae43277b45d9b89296fd777032/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/tmp/__pdg__/dist/code/33169ea97e0f3858dcfe135892a94144be15e4ae43277b45d9b89296fd777032/node_modules/.pnpm/axios@0.21.4/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (node:events:525:35)
    at null.endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

I’m sorry you’re experiencing a 404 error. It seems like the requested file or resource was not found. To help you resolve this issue, I’ll need more information about the code you’re running and the API you’re trying to access. Please provide more details so I can assist you better.

import { axios } from@pipedream/platform”;
import FormData from “form-data”;

export default defineComponent({
props: {
google: {
type: “app”,
app: “google”,
},
fileId: {
type: “string”,
label: “File ID”,
description: “The ID of the image file in your Google Drive”,
},
stabilityApiKey: {
type: “string”,
label: “Stability.ai API Key”,
description: “Your Stability.ai API key”,
},
},
async run({ $ }) {
// Get the image file from Google Drive
const response = await axios($, {
url: https://www.googleapis.com/drive/v3/files/${**this**.fileId}?alt=media,
headers: {
Authorization: Bearer ${**this**.google.$auth.oauth_access_token},
},
responseType: “arraybuffer”,
});

**if** (response.data) {
  _// Create FormData for [Stability.ai](http://Stability.ai) API_
  **const** formData = **new** FormData();
  formData.append("image", Buffer.**from**(response.data), "image.png");
  formData.append("height", 0);

  _// Send the image to the [Stability.ai](http://Stability.ai) API_
  **const** stabilityApiUrl = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale";

  **return** **await** axios($, {
    method: "POST",
    url: stabilityApiUrl,
    headers: {
      ...formData.getHeaders(),
      Accept: "application/json",
      Authorization: `Bearer ${**this**.stabilityApiKey}`,
    },
    data: formData,
  });
} **else** {
  **throw** **new** Error("The response data is undefined. Please check the file ID and try again.");
}

},
});

Error
The response data is undefined. Please check the file ID and try again.
DETAILS

    at Object.run (file:///tmp/__pdg__/dist/code/33169ea97e0f3858dcfe135892a94144be15e4ae43277b45d9b89296fd777032/component.mjs:51:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at null.executeComponent (/var/task/launch_worker.js:229:22)
    at MessagePort.messageHandler (/var/task/launch_worker.js:726:28)