Heroku deployment failing with custom plugin

Hi!

I am trying to deploy my strapi backend to heroku, but I am getting an error when it tries to build the plugin. Error below

remote: -----> Build
remote:        Running build (yarn)
remote:        yarn run v1.22.17
remote:        $ strapi build
remote: Error: ./src/plugins/email couldn't be resolved
remote:     at toDetailedDeclaration (/tmp/build_20a6ac54/node_modules/@strapi/strapi/lib/core/loaders/plugins/get-enabled-plugins.js:38:15)
remote:     at /tmp/build_20a6ac54/node_modules/@strapi/strapi/lib/core/loaders/plugins/get-enabled-plugins.js:86:10
remote:     at /tmp/build_20a6ac54/node_modules/lodash/lodash.js:4967:15
remote:     at baseForOwn (/tmp/build_20a6ac54/node_modules/lodash/lodash.js:3032:24)
remote:     at /tmp/build_20a6ac54/node_modules/lodash/lodash.js:4936:18
remote:     at Function.forEach (/tmp/build_20a6ac54/node_modules/lodash/lodash.js:9410:14)
remote:     at getEnabledPlugins (/tmp/build_20a6ac54/node_modules/@strapi/strapi/lib/core/loaders/plugins/get-enabled-plugins.js:82:5)
remote:     at async module.exports (/tmp/build_20a6ac54/node_modules/@strapi/strapi/lib/commands/build.js:24:19)

The build works just fine locally, but I am having trouble with the deployment. Thanks in advance.