59 questions
1
vote
1
answer
162
views
Jest + ts‑jest: wrong line numbers in stack‑trace (source‑map issue with config package)
I’m unit‑testing a TypeScript/Node back‑end.
When my test fails, Jest’s stack‑trace points to the wrong line in the original source (off by a few lines). I suspect source‑maps are broken but can’t see ...
1
vote
1
answer
238
views
Error: Configuration property "mongoURI" is not defined, when trying to deploy my api on render.com
I have trouble getting my web service up and running. I developed a full stack MERN application and have my client folder already successfully deployed. However, when I try to deploy my backend folder ...
1
vote
2
answers
2k
views
Node-config: How to pick environment specific config file
In our Node.JS application, we have been specifying application environments (dev, qa, stage, prod, etc.) in package.json as below:
"start-prod": "NODE_ENV=prod node ./bin/www",
&...
1
vote
1
answer
2k
views
Ensuring Azure keyvault secrets are loaded to config (node-config) at application startup
I have a NodeJS application that uses Node-Config (https://www.npmjs.com/package/config) to load application configurations. What I'm trying to do is to load secrets from Azure Keyvault to the config ...
0
votes
2
answers
2k
views
understanding node.js-module 'config' and default.json & production.json & my actual problem with a "Configuration property"
https://github.com/node-config/node-config
Quote from github:
Install in your app diectory, and edit the default config file:
$ npm install config
$ mkdir config
$ vi config/default.json"
here ...
0
votes
1
answer
2k
views
Config is not loading & getting-error -> configuration-property-MAX_CONNECTIONS-is-not-defined
I have a node.js app & have some configurations based on the environment. So decided to use
https://www.npmjs.com/package/config
In accordance, I created a folder named config at the root level of ...
0
votes
1
answer
479
views
config(npm) throws configuration property not found but getConfigSources method logs correct object
I am trying to integrate config package in my nx.dev typescript project. I have a config directory at root level that contains default.json
{
"server": { "port": 3001 }
}
in my ...
2
votes
1
answer
4k
views
node-config Error [ERR_REQUIRE_ESM]: Must use import to load ES Module /default.js
I am using ESM in my node project. Added "type": "module" in package.json
// index.js
import config from 'config'
// default.js
export default {
time: 123,
...
...
}
But ...
0
votes
1
answer
4k
views
Get config value in vue file
possibly a very simple question: I need to get a configuration value from within an html block in a vue file.
I have this simple config.js
const env = process.env.NODE_ENV
const development = {
...
1
vote
0
answers
304
views
"Cannot read property" when using deferConfig of node-config in "TypeScript
I'm using node-config in TypeScript.
I have the code like below:
config/default.ts:
import {deferConfig} from 'config/defer';
export default {
service: {
url: 'http://localhost',
errorUrl: ...
0
votes
0
answers
71
views
Is there a way to define configuration structure for intellisense with "config" npm package?
I am using config module from npm with JS or TS.
let's imagine I have the following default.json:
{
"database": {
"username": "admin",
"password": &...
5
votes
1
answer
5k
views
Mock specific config value in jest
I have the following default/config.js file
/* eslint-disable @typescript-eslint/no-var-requires */
require('dotenv').config({
path: require('find-config')('.env'),
});
module.exports = {
...
0
votes
1
answer
310
views
Setting up the environment vars in node before the config module reads the config from default.json
Comparatively new to JS and node,
Requirement:
Need to set the environment variables after reading it from a secure store before the config module is loaded.
Details:
We have an ask where we need to ...
3
votes
2
answers
5k
views
mock node config with jest
I introduce myself currently for the first time in jest and nodejs.
I am facing the problem that I have to mock two different values from the nodejs config.
jest.mock('config')
mockConfigTtl = require(...
1
vote
1
answer
457
views
Bypass NODE_ENV with node-config
I am trying to test my config files by validating them, nothing fancy, a schema, a list of envs, iterate over it, load the config and validate the variable against the schema.
Problem is, to do that, ...