App on Heroku crashed after update from v.3.3.4 to v.3.4.0

Hi @mingxi
The solution you are pointing to solves it for a sql db as far as I can see. I’m using mongodb and get a similar problem.

The code was tested on localhost and works just fine connecting to the same db. But on heroku I get this error:

2021-01-11T19:37:55.000000+00:00 app[api]: Build succeeded
2021-01-11T19:38:00.498308+00:00 app[web.1]: [2021-01-11T19:38:00.497Z] error Bootstrap function in plugin “users-permissions” failed
2021-01-11T19:38:00.500435+00:00 app[web.1]: [2021-01-11T19:38:00.500Z] error TypeError: Cannot read property ‘_id’ of undefined
2021-01-11T19:38:00.500437+00:00 app[web.1]: at /app/node_modules/strapi-plugin-users-permissions/services/UsersPermissions.js:263:59
2021-01-11T19:38:00.500459+00:00 app[web.1]: at Array.map ()
2021-01-11T19:38:00.500461+00:00 app[web.1]: at Object.updatePermissions (/app/node_modules/strapi-plugin-users-permissions/services/UsersPermissions.js:262:46)
2021-01-11T19:38:00.500463+00:00 app[web.1]: at processTicksAndRejections (node:internal/process/task_queues:93:5)
2021-01-11T19:38:00.500464+00:00 app[web.1]: at async module.exports (/app/node_modules/strapi-plugin-users-permissions/config/functions/bootstrap.js:186:3)
2021-01-11T19:38:00.500466+00:00 app[web.1]: at async Promise.all (index 6)
2021-01-11T19:38:00.500466+00:00 app[web.1]: at async Strapi.runBootstrapFunctions (/app/node_modules/strapi/lib/Strapi.js:405:5)
2021-01-11T19:38:00.500467+00:00 app[web.1]: at async Strapi.load (/app/node_modules/strapi/lib/Strapi.js:337:5)
2021-01-11T19:38:00.500467+00:00 app[web.1]: at async Strapi.start (/app/node_modules/strapi/lib/Strapi.js:191:9)
2021-01-11T19:38:00.567805+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-01-11T19:38:00.568469+00:00 app[web.1]: npm ERR! errno 1