Missing JwtSecret error while deploying on heroku

Hello ,

I’m using strapi v4, all works in develop mode but when i follow the guide on official strapi doc to deploy on heroku i got this message error.

i tried to create new project but got the same error.

1 Like

run in your terminal and put that value in one line as your JWT_SECRET
openssl rand 256 | base64

hello i am new to strapi and have no devops experience at all

followed heroku deployment doc to the letter and it does not work just like OP

i have no idea what to do with your solution

could you explain it in details for such newbies like me? thanks

I’ve had similar problems when deploying from staging → production using “Promote to production”. For some unimaginable reason Heroku pushes the staging deployment along with the staging environmental variables.

I’m not sure this addresses this problem, but maybe it could help.

If you downgrade to strapi 4.1.7 this error disappears, maybe theres coming a bugfix soon


you probably did not have a JWT_SECRET when you copied them from local to heroku. If you create one and re-copy you should be fine (or generate new ones with the indicated openssl commands)