Skip to content

TypeError: handler is not a constructor  #38

@engin

Description

@engin

Hello, i'm getting an error just like the same as in the #36
But the weird thing is, the exception only happening on CI/CD which i tried to use both latest alpine and stretch images.
Here is the packages in use:

npm-check-updates
[INFO]: You can also use ncu as an alias
Checking /Users/engin/ips/kapca/package.json
[====================] 27/27 100%

 convict                     ^5.1.0  →   ^5.2.0
 core-js                    ^2.6.10  →   ^3.3.3
 debug                       ~2.6.9  →   ~4.1.1
 express                    ~4.16.1  →  ~4.17.1
 eslint                     ^4.19.1  →   ^6.5.1
 eslint-config-airbnb-base  ^12.1.0  →  ^14.0.0
 eslint-plugin-import       ^2.11.0  →  ^2.18.2
 husky                      ^0.14.3  →   ^3.0.9
 jest                       ^24.8.0  →  ^24.9.0
 nodemon                    ^1.17.3  →  ^1.19.4
 shx                         ^0.2.2  →   ^0.3.2
 supertest                   ^3.0.0  →   ^4.0.2

and here is the stack trace from the jest output

    TypeError: handler is not a constructor

      18 | // const mappedRoutes = mapRoutes(routes, 'api/controllers/');
      19 | // eslint-disable-next-line new-cap
    > 20 | const mappedRoutes = new mapRoutes(routes, 'api/controllers/');
         |                      ^
      21 | app.use('/', mappedRoutes);
      22 |
      23 |

      at node_modules/express-routes-mapper/lib/index.js:108:15
          at Array.forEach (<anonymous>)
      at new mapRoutes (node_modules/express-routes-mapper/lib/index.js:56:13)
      at Object.<anonymous> (config/routes.js:20:22)
      at require (test/_setup.js:18:3)
      at Object.beforeAction (test/controllers/CaptchaController.test.js:15:15)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions