R
Railway14mo ago
BerL

Environment variables with escape characters get modified during railway deployment ?

I set an environment variable like this /vercel\.app$/ However, when I print my variable using console.log whens trating my app. I got this '/vercel\\.app$/' Why is the escape character doubled ? Thank you,
12 Replies
Percy
Percy14mo ago
Project ID: b77771e8-a1f4-4676-a824-36c14d7facfa
BerL
BerLOP14mo ago
b77771e8-a1f4-4676-a824-36c14d7facfa project ID: b77771e8-a1f4-4676-a824-36c14d7facfa
Brody
Brody14mo ago
there's an extra backslash to escape the period?, I don't see how this is an issue?
BerL
BerLOP14mo ago
Sorry, there was an error in my original message. In my original message, the text was interpreted by the editor. I edited it and added it within a code block, so you can see the issue One escape character is changed into two escape characters. How we can enter in the environement gui a text that will not be reinterpreted/modified by Railways editor
Brody
Brody14mo ago
try using the raw editor
BerL
BerLOP14mo ago
Imposible, I am told the json is invalid the editor automaically add a double escape to make it a valid json
Brody
Brody14mo ago
use the k=v format, not the json format
BerL
BerLOP14mo ago
i'll try and let you know thanks
Brody
Brody14mo ago
and if it's still escaping, its plenty easy enough to code around in your app
BerL
BerLOP14mo ago
This is still escaping. Clearly I could code around, but I would expect from railway a proper solution
Brody
Brody14mo ago
not liking that attitude tbh
BerL
BerLOP14mo ago
Don't take it personally, but I spent a few hours figuring out that issue, and I didn't see any hint in the documentation telling that the env variables are handled as a json rather than a string
Want results from more Discord servers?
Add your server