#Render.com config error

32 messages · Page 1 of 1 (latest)

feral palm
#
==> Running 'node src/index.js'
/opt/render/project/src/node_modules/config/lib/config.js:1006
    } else if (Utils.isRegExp(parent)) {
                     ^
TypeError: Utils.isRegExp is not a function
    at _clone (/opt/render/project/src/node_modules/config/lib/config.js:1006:22)
    at Config.cloneDeep (/opt/render/project/src/node_modules/config/lib/config.js:1046:10)
    at /opt/render/project/src/node_modules/config/lib/config.js:1318:32
    at Array.forEach (<anonymous>)
    at util.extendDeep (/opt/render/project/src/node_modules/config/lib/config.js:1293:9)
    at /opt/render/project/src/node_modules/config/lib/config.js:651:12
    at Array.forEach (<anonymous>)
    at util.loadFileConfigs (/opt/render/project/src/node_modules/config/lib/config.js:648:16)
    at new Config (/opt/render/project/src/node_modules/config/lib/config.js:113:27)
    at Object.<anonymous> (/opt/render/project/src/node_modules/config/lib/config.js:1510:31)

App runs locally and used to run on Render.com 11 months ago.
But now on trying to deploy (code hasn't changed) it throws this error.

glad gyro
#

Why do you have “config” in node_modules?

feral palm
#

I use this package

#
#

On render though I overwrite the sensitive values with environment variables

glad gyro
#

Well it’s failing. Version you’re using on Render must not match the one you’re using locally. FWIW, that’s a terribly named package…

feral palm
#

Oh yeah, its a handy package though. It's a bit like appsettings.{Environment}.json in .NET Apps.

#

Of course you only store insensitive data there

feral palm
#

I also got it setup to run yarn on every build

#

So it should get the latest, no?

glad gyro
#

The most recent that matches your package.json, sure… likely not what you have installed locally…

feral palm
#

Hmm I recloned the project locally and did a yarn, so it should also be the latest matching package.json

#

But yeah render might be confused and may have an older version?

glad gyro
#

Different Node version

#

Must have moved from Utils.isRegExp to Utils.types.isRegExp

feral palm
#

Locally I am using Node.js v20.10.0 on Render it uses Node.js v23.3.0

#

That's probably it yeah

feral palm
feral palm
#

Thanks!

feral palm
#

Thanks

#

So is it good practice to use ^ for node value ^20.10.0?
And manually change it when you wanna update to a new Major version?

spring rover
#

(can you not update node on render?)

feral palm
#

It uses the one out of your package.json.

#

If that's what you meant?

spring rover
#

Then update to lts at least

glad gyro
#

Render was using newer than his local version. Newer version depracated Util.isRegExp forcing the usage of Util.types.isRegExp

#

(Yes they should update but that config package apparently breaks with 23.x)

spring rover
#

Fair enough, LTS 22 and when you have time, PR to the config package 👍