I’m using this code to send a message to the queue, based on the documentation here:
import { Queue } from '@mondaycom/apps-sdk';
...
const sendToQueue = async (payload): Promise<String> => {
console.log('Send this to the queue', payload);
const queue = new Queue();
const messageContent = JSON.stringify(payload);
return queue.publishMessage(messageContent);
};
It’s throwing the following error (when run locally through ngrok):
file:///path/to/my-project/node_modules/@mondaycom/apps-sdk/dist/esm/utils/env.js:9
throw new Error('En environment variable name "MNDY_SERVER_ADDRESS" is required, the value should be int the following format "(protocol)://{server_name}:{port}" e.g.: "http://localhost:8080".');
^
Error: En environment variable name "MNDY_SERVER_ADDRESS" is required, the value should be int the following format "(protocol)://{server_name}:{port}" e.g.: "http://localhost:8080".
at localServerAddress (file:///path/to/my-project/node_modules/@mondaycom/apps-sdk/dist/esm/utils/env.js:9:15)
at QueueDev.<anonymous> (file:///path/to/my-project/node_modules/@mondaycom/apps-sdk/dist/esm/queue/queue.dev.js:57:33)
at step (file:///path/to/my-project/node_modules/@mondaycom/apps-sdk/dist/esm/queue/queue.dev.js:32:23)
at Object.next (file:///path/to/my-project/node_modules/@mondaycom/apps-sdk/dist/esm/queue/queue.dev.js:13:53)
at file:///path/to/my-project/node_modules/@mondaycom/apps-sdk/dist/esm/queue/queue.dev.js:7:71
at new Promise (<anonymous>)
at __awaiter (file:///path/to/my-project/node_modules/@mondaycom/apps-sdk/dist/esm/queue/queue.dev.js:3:12)
at QueueDev.publishMessage (file:///path/to/my-project/node_modules/@mondaycom/apps-sdk/dist/esm/queue/queue.dev.js:53:16)
at sendToQueue (/path/to/my-project/src/routes/integrations/actions/copy-sharepoint-folder/+server.ts:103:16)
at POST (/path/to/my-project/src/routes/integrations/actions/copy-sharepoint-folder/+server.ts:56:7)
Help!
- What’s going on with the error above?
- Where does
MNDY_SERVER_ADDRESS
come from? - I’ve not seen
MNDY_SERVER_ADDRESS
anywhere in the docs