I recently added a lifestyle hook to send an email after an entry is added. I went to deploy my new changes to heroku and now my admin panel is just a blank white page. Everything worked great in development mode and there are no errors in the heroku logs.
I’ve read through some of the other posts about fixes people had but none have worked. I’ve changed my versions of node/npm but still have the problem. The only other solution I’ve seen is to clone the repo and deploy a new version of Strapi while losing all data. This doesn’t seem like a great solution.
Does anyone have any other solutions or has Strapi said anything about this issue?
Error in console:
Uncaught ReferenceError: regeneratorRuntime is not defined
at main.f7698254.js:2:1004432
at Object.423 (main.f7698254.js:2:1005324)
at e (main.f7698254.js:2:1011511)
at Object.1261 (main.f7698254.js:2:984807)
at e (main.f7698254.js:2:1011511)
at Object.9321 (main.f7698254.js:2:994496)
at e (main.f7698254.js:2:1011511)
at main.f7698254.js:2:1011537
at Object.94344 (main.f7698254.js:2:1011554)
at s (runtime~main.66f28d16.js:1:141)
Hook code:
module.exports = {
async afterCreate(event) {
const { result, params } = event;
// send new listing email to admins
const emailTemplate = {
subject: "New listing added and needs reviewed",
text: `A new listing has been added and needs reviewed.
Title: <%= result.title %>
Contact: <%= result.contact_firstname %> <%= result.contact_lastname %>
Admin Panel`,
html: `<p>A new listing has been added and needs reviewed.</p>
<p>Title: <%= result.title %></p>
<p>Contact: <%= result.contact_firstname %> <%= result.contact_lastname %></p>
<p><a href="[URL]/admin/content-manager/collectionType/api::listing.listing/<%= result.id %>" target="_blank">Admin Panel</a></p>`,
};
await strapi.plugins["email"].services.email.sendTemplatedEmail(
{
to: "[EMAIL]",
},
emailTemplate,
{
result: _.pick(result, [
"id",
"title",
"contact_firstname",
"contact_lastname",
]),
}
);
},
};