Heroku environmental variables require extra quotes around values
See original GitHub issueThe environmental variables MICROPUB_PERMALINK_STYLE
, MICROPUB_MEDIA_FILES_STYLE
, MICROPUB_FILENAME_STYLE
require quotes around the values in the Heroku configuration, though the rest don’t. This manifests as “app crashed” in the Heroku logs if you do not include them.
I’m guessing it’s because the values are parsed as JSON as their first step. It may be worth documenting these keys as requiring the extra quotes because it took me a little while to figure it out. At the very least, hopefully this issue is discoverable.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
environment variables in heroku - Stack Overflow
i have this firebase config file. in my procfile i have: web: NODE_ENV=production node ./src/server/index.js. in my webpack i have:
Read more >Configuration and Config Vars - Heroku Dev Center
Accessing config var values from code ... Config vars are exposed to your app's code as environment variables. For example, in Node.js you...
Read more >Configure the Heroku Environment Variables
If you're working from a Windows computer, you may need to replace the single quotes with double quotes ("). Enter this command: heroku...
Read more >How to set Heroku environmental variables from dotenv (.env ...
Heroku allows you to set and unset environmental variables using their CLI, but manually writing the values is tedious, and sometimes you ...
Read more >Environment Variables - Travis CI Docs
Define environment variables in your .travis.yml in the env key, ... In particular, if a value contains spaces, you need to put quotes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m using the website to edit the environmental variables. I believe this is only required for values that are strings. If they are valid JSON, like that object in the screenshot, it’s able to parse it. Here’s an example of what I’m using that parses without issue:
If I take out the wrapping
"
around the value, it blows up atb
trying to turn that into JSON (since literals aren’t supported in JSON like that).I haven’t tried using the more advanced JSON (like the dictionary matching) yet. From my perspective you’ve got a few options for configuration:
.well-known
each time a micropub comes in.I think the last two, with some kind of dry-run-able transaction support, would be an easier way to get the configuration working.
I ended up reverting a few commits to my repo while getting things set up. Now that I think about it, allowing me to specify which branch to commit to would also help.
Sorry for not being responsive here – life kind of got in the way.
Are you @zacwest and @pmarsceill saying that even non-JSON configurations needs quotes and escaping? Plain strings should work with no extra effort at all – else it’s a bug