mondaycom / monday-sdk-js

Node.js and JavaScript SDK for developing over the monday.com platform
https://monday.com
MIT License
87 stars 39 forks source link

Constants not loaded correctly when NODE_ENV set to "development" #115

Closed Anton-Plagemann closed 11 months ago

Anton-Plagemann commented 1 year ago

Hi,

there seems to be a bug with the loading of basic constants affecting dev environments. In my case the constants were mostly loaded as "undefined" which leads to an url like this 'undefined://undefinedundefined/v2' which is obviously not working. The issue seems to be for me in line 10 with process.env[key] !== "undefined", I think this should be changed to process.env[key] !== undefined for a correct comparison.

https://github.com/mondaycom/monday-sdk-js/blob/c27a313b0aa4209f4c56028fcd4e7e88cc1a9314/src/constants.js#L9-L11

I have in my .env file NODE_ENV=development.
I included the following vars in my .env which fixed it as a workaround for now:

# Temporary fix for monday.com api sdk
MONDAY_COM_PROTOCOL=https
MONDAY_COM_DOMAIN=monday.com
MONDAY_SUBDOMAIN_API=api.
MONDAY_OAUTH_SUBDOMAIN=auth.

I'm happy to assist in all follow-up questions 😊

Edit: It seems like there is already an open pr for that: #118

Anton-Plagemann commented 11 months ago

Seems to be fixed, closing.