Mapps deployment fail

My mapps deployment fails as soon as I import the client from the aws-sdk dependency I have in my integration.

It throws a heap out of memory error.
See attached images




Anybody know how to fix this please?

I don’t know what you’re trying to do, but it seems unusual to be connecting to an AWS-hosted document DB from monday-code running on GCP.

Looking at the code though you can’t be using process.env on monday-code. Only locally.

In this code snippet –

import AWS from 'aws-sdk';

AWS.config.update({
	region: 'eu-west-2', // your region
	accessKeyId: process.env.AWS_ACCESS_KEY_ID, 
	secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
});

export default new AWS.DynamoDB.DocumentClient();

– rather than using process.env to get your variables/secrets, you should using monday-specific code such as:

import AWS from 'aws-sdk';
import { EnvironmentVariablesManager } from '@mondaycom/apps-sdk';
import { SecretsManager } from '@mondaycom/apps-sdk';

const region = 'eu-west-2';

// get the access key from the environment variable & failback to `process.env` locally
const environment = new EnvironmentVariablesManager();
const accessKeyId = environment.get('AWS_ACCESS_KEY_ID') ?? process.env.AWS_ACCESS_KEY_ID;

// get the secret from the secret store & failback to `process.env `locally
const secretsManager = new SecretsManager();
const secretAccessKey = secretsManager.get('AWS_SECRET_ACCESS_KEY') ?? process.env.AWS_SECRET_ACCESS_KEY;

AWS.config.update({ region, accessKeyId, secretAccessKey });

export default new AWS.DynamoDB.DocumentClient();

This will allow you to configure the environment variables and secrets within the developer center for the app.

I have no idea if this will fix the deploy problems though.

1 Like

Hi @dvdsmpsn
Thanks for the response, but that’s not the issue.
I’ve been using process.env in my integration prior to the error for months.
The same goes for environment variables and secrets from the developer center.

But just to verify I used your suggestion utilizing @mondaycom/apps-sdk.
It still spits out the same error.

However using cross-env and increasing the allowed heap size removed the error:

  "scripts": {
    "start": "cross-env NODE_OPTIONS=--max-old-space-size=4096 ts-node ./src/app.ts",
  },

Now it throws the following error:

In order for the deployment to be successful, the container should be up and listen on port 8302.

Hi @Matias.Monday
I posted this question 2 weeks ago.

Can you please help explain what is needed to get it working properly?

Setting my port to the internal 59999 Monday.Code uses, removes the error and allows the deploy.
But the deploy doesn’t actually work.

This can be seen by attempting to access one of it’s unprotected endpoints after a deploy.
Which in browser doesn’t display what it should when visited.