strapi-community/strapi-plugin-publisher

requiring functions from other file breaks build

TasosBak opened this issue · 4 comments

Whenever I try to require a funtion from another file, the build process strops at "Admin UI built successfully". Do you have any suggestions?

Versions:

    "@strapi/strapi": "4.14.0",
    "strapi-plugin-publisher": "^1.5.0",

config/plugins.js file

const { myFunction } = require("../utils");

module.exports = ({ env }) => ({
    'publisher': {
        enabled: true,
        config: {
            hooks: {
                afterPublish: async ({
                    strapi,
                    uid,
                    entity
                }) => {
                    myFunction(uid, entity);
                },
                afterUnpublish: async ({
                    strapi,
                    uid,
                    entity
                }) => {
                    myFunction(uid, entity);
                },
            },
            components: {
                dateTimePicker: {
                    step: 5
                }
            }
        },
    },
});

Thanks for the report, I will look into this.

It does look like this is something wrong with strapi in general for this use case as opposed to this plugin.

This seems to be something specific to your setup as I was not able to reproduce this with my own fresh installation (latest and version you specified).

did you do yarn/npm build and it completed? Forgot to mention that yarn develop works for me too but yarn build breaks.

Nevermind, it probably has something to do with my setup because I tried importing a dummy function and it worked so it has something to do with the functionality of the functions I'm importing and not the importing itself.

Thanks a lot for looking into it!