System Information
- Strapi Version: 4.1.9
- Operating System: Win10
- Database: mysql
- Node Version: 16.13.2
- NPM Version: 8.1.2
- Yarn Version: n/a
Hi,
When working with the strapi documentation and following the code example in the Hooks API chapter, the log “console.log(args)” didn’t show up anywhere. When there was other code in the same “bootstrap(app)”-section an error was thrown, which would mean that the code inside is getting reached, but the log doesn’t seem to log anywhere.
register(app) {
app.createHook('new-hook/hooks');
app.registerPlugin({
id: pluginId,
initializer: Initializer,
isReady: false,
name,
});
},
bootstrap(app) {
app.registerHook('new-hook/hooks', (...args) => {
console.log("args-log: ", args)
// ...
return args
});
},
I followed the strapi documentation on hooks-api.
Does anyone see what’s wrong?