Heroku Git Clone - Yarn Develop Key Error

System Information
  • Strapi Version: v4
  • Operating System: 12.2
  • Database: sqlite
  • Node Version: v16.13.1
  • NPM Version: v8.1.2
  • Yarn Version: 1.22.17

Hello, I just walked through the Strapi Heroku installation guide on my linux box and everything seems to work well. I can update the Strapi’s content type and all that locally and it deploys to Heroku’s git fine.

The issue I’m having is git cloning the repo and getting the development server to launch on my M1 Mini. The error is asking me to set up my keys variable but I am not clear on how this should be set up for development. I have the key working fine on the production need guidance on the development side from a cloned repo, after running yarn install and yarn develop.

I’m cloning with: heroku git:clone -a myappname

Thanks in advance!

Dorian

Error: [2022-01-29 20:44:48.988] error: Middleware “strapi::session”: App keys are required. Please set app.keys in config/server.js (ex: keys: [‘myKeyA’, ‘myKeyB’])
Error: Middleware “strapi::session”: App keys are required. Please set app.keys in config/server.js (ex: keys: [‘myKeyA’, ‘myKeyB’])

module.exports = ({ env }) => ({
  host: env('HOST', '0.0.0.0'),
  port: env.int('PORT', 1337),
  app: {
    keys: env.array('APP_KEYS'),
  },
});


I ended up switching my dev environment to postgresql and connecting to my remote heroku database to get around this issue. Not sure it’s best practice but it’s working out fine for now. :+1:

D

I am having the same issue

You just need to add the APP_KEYS environment variable. Explanation can be find here. Just remember to add real keys, like for instance a GUID. You can generate some here: Free Online GUID Generator or using this on your terminal:

openssl rand -hex 64