jazida-opensource / dotenv-azure

🛠 Load environment variables from Azure's services App Configuration, Key Vault or a .env file
MIT License
10 stars 4 forks source link

🐛 sync-rpc failing with senseless error while pre-loading dotenv-azure #812

Open aronhoyer opened 1 year ago

aronhoyer commented 1 year ago

When pre-loading dotenv-azure into a start script for an Azure Function, extractValue from sync-rpc throws an error without a message or code:

/path/to/project/directory/node_modules/sync-rpc/lib/index.js:167
    throw error;
    ^

Error
    at extractValue (/path/to/project/directory/node_modules/sync-rpc/lib/index.js:165:19)
    at /path/to/project/directory/node_modules/sync-rpc/lib/index.js:175:12
    at Object.<anonymous> (/path/to/project/directory/node_modules/dotenv-azure/config.js:5:20)
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
    at Module.load (node:internal/modules/cjs/loader:1033:32)
    at Function.Module._load (node:internal/modules/cjs/loader:868:12)
    at Module.require (node:internal/modules/cjs/loader:1057:19)
    at Module._preloadModules (node:internal/modules/cjs/loader:1332:12)
    at loadPreloadModules (node:internal/bootstrap/pre_execution:583:5) {
  code: undefined
}

The AZURE_APP_CONFIG_CONNECTION_STRING is set to a read-only connection string from our team's App Configuration.

Start script: node -r dotenv-azure/config scripts/start.js

Node version: v16.18.1 NPM version: v8.19.2

Repo: https://github.com/equinor/data-marketplace-adapter-service/tree/d2bfcda2e94f955c813dae597683de2fb24e8d42