SoftwareBrothers / adminjs-hapijs

Hapijs integration for AdminJS
MIT License
20 stars 12 forks source link

Error in runing adminjs-hapijs #61

Closed kidozh closed 1 year ago

kidozh commented 1 year ago

When I run the package it suddenly appears that:

node_modules/@adminjs/hapi/src/extensions/session-auth.ts:49:18 - error TS2322: Type '{ 'hapi-auth-cookie': { redirectTo: false; }; }' is not assignable to type 'PluginSpecificConfiguration'.
  Object literal may only specify known properties, and ''hapi-auth-cookie'' does not exist in type 'PluginSpecificConfiguration'.

49       plugins: { 'hapi-auth-cookie': { redirectTo: false } },
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@adminjs/hapi/src/plugin.ts:156:15 - error TS18046: 'e' is of type 'unknown'.

156           if (e.statusCode >= 400 && e.statusCode < 500) {
                  ~

node_modules/@adminjs/hapi/src/plugin.ts:156:38 - error TS18046: 'e' is of type 'unknown'.

156           if (e.statusCode >= 400 && e.statusCode < 500) {
                                         ~

node_modules/@adminjs/hapi/src/plugin.ts:157:32 - error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'Error'.

157             throw Boom.boomify(e, { statusCode: e.statusCode });
                                   ~

node_modules/@adminjs/hapi/src/plugin.ts:157:49 - error TS18046: 'e' is of type 'unknown'.

157             throw Boom.boomify(e, { statusCode: e.statusCode });
                                                    ~

node_modules/@adminjs/hapi/src/plugin.ts:161:32 - error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'Error'.

161             throw Boom.boomify(e);

Even though I replace depreciated hapi-auth-cookie with @hapi/cookie, it still doesn't work.

Is there anything to resolve it?