a month ago
I had a variable containing a valid JSON string, including newlines within string values represented with the \n sequence, in a preview environment. I used the "Import from <environment>" action in the "Variables are included in other environments but missing in this one" section. The value in the destination environment contained actual newlines instead of the \n sequences, causing the app's JSON parse of that environment variable to fail (since a newline is not allowed inside a string literal in JSON).
This is only a bug report; I have manually replaced the value of the variable and don't need further assistance.
4 Replies
a month ago
Hey there! We've found the following might help you get unblocked faster:
🧵 Environment Variables in ViteJS Not Available at Build Time on Railway
📚 Deploy Node.js & Express API with Autoscaling, Secrets, and Zero Downtime
If you find the answer from one of these, please let us know by solving the thread!
a month ago
QQ, did you use the RAW variable editor or the inline editor when adding this multi-line variable?
Status changed to Awaiting User Response Railway • about 1 month ago
angelo-railway
QQ, did you use the RAW variable editor or the inline editor when adding this multi-line variable?
a month ago
Initially I used neither - I just used the import button and immediately clicked Deploy without looking at the value. When I started to suspect a newline issue based on the app logs, I viewed it through both the RAW and inline editors and both rendered the newlines (i.e. the value was split over multiple lines in both editors; it only showed the bottom line in the inline editor but I used Cmd+A Cmd+C to copy the full value into a text editor and it had multiple lines)
Status changed to Awaiting Railway Response Railway • about 1 month ago
a month ago
Oh, very likely then it's with the import flow. I think I will go and mark it as known but I am unsure if we can land a fix given the bug backlog.
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 26 days ago