hapijs / glue

Server composer for hapi.js
Other
245 stars 62 forks source link

plugin.name is required #150

Open Muhammad406 opened 7 months ago

Muhammad406 commented 7 months ago

Runtime

Node.js

Runtime version

18.19.0

Module version

9.0.1

Used with

@hapi/hapi

Any other relevant information

I am trying to write a Manifest for Glue compose. I am able to add and play custom plugin. I would like to include npm package as a plugin dependency for custom plugin in manifest but on execution i am incurring a validation error "plugin".name is required whenever i used node_module package directly.

Example is below,

the custom plugin sn-db works and executes, while hapi-auth-jwt crashed with the error explained above. Tried to make it an object and give it a name but still stuck at the same issue. What should be the approach for this as i cannot see anything in the documentation for using node_module package directly?

How can we help?

xport let Manifest = { server: { port: sample_port }, register: { plugins: [ { plugin: require('hapi-auth-jwt'), }, { plugin: relativeToRoot('plugins/sn-db'), options: [ { sequelizeTS: { database: dbSettings.db.database, username: dbSettings.db.username, password: dbSettings.db.password, modelPaths: [relativeToRoot('models/!(index).js')], host: dbSettings.db.host, dialect: 'postgres', logging: dbSettings.db.logging ? console.log : false, operatorsAliases: false, define: { }, }, }, ], } ] } }