TypeError: Class constructors cannot be invoked without 'new'
See original GitHub issueTrying to test koa 2 alpha, getting this error:
constructor() {
10/28/15 06:20:06
aidax-collector-1 aidax[1491]: ^
10/28/15 06:20:06
aidax-collector-1 aidax[1491]: TypeError: Class constructors cannot be invoked without 'new'
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at require (module.js:384:17)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at normalLoader (/app/releases/20151028201122/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:199:5)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at startup (node.js:117:18)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Function.Module.runMain (module.js:475:10)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Module._compile (module.js:434:26)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Object.Module._extensions..js (module.js:452:10)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Module.load (module.js:355:32)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Function.Module._load (module.js:310:12)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Object.<anonymous> (/app/releases/20151028201122/node_modules/koa-cluster/lib/http.js:9:11)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at require (module.js:384:17)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Module.require (module.js:365:17)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Function.Module._load (module.js:310:12)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Module.load (module.js:355:32)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Object.<anonymous> (/app/releases/20151028201122/index.js:6:1)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Module._compile (module.js:434:26)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Object.Module._extensions..js (module.js:452:10)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at node.js:951:3
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Module.require (module.js:365:17)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Module.load (module.js:355:32)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Function.Module._load (module.js:310:12)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Object.require.extensions.(anonymous function) [as .js] (/app/releases/20151028201122/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:216:7)
10/28/15 06:20:05
aidax-collector-1 aidax[1491]: at Module._compile (module.js:434:26)
Issue Analytics
- State:
- Created 8 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Class constructor Client cannot be invoked without 'new' - ...
When I try to execute nodemon command I always see this error TypeError: Class constructor Client cannot be invoked without 'new'.
Read more >Typescript: TypeError: Class constructor cannot be invoked ...
Bug report. Getting the following error in my project: TypeError: Class constructor cannot be invoked without 'new'.
Read more >Javascript ES6 TypeError Class constructor Client cannot ...
When I try to execute nodemon command I always see this error TypeError: Class constructor Client cannot be invoked without 'new'.
Read more >Class constructor SweetAlert cannot be invoked without ...
Uncaught TypeError: Class constructor SweetAlert cannot be invoked without 'new' ... Hi,. After updating meteor version, I can not use the ...
Read more >Reactjs " Class constructor upload cannot be invoked ...
Uncaught TypeError: Class constructor Upload cannot be invoked without 'new'. i dont know what to do with it:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In koa2 you need to do
const app = new Koa()
instead ofconst app = koa()
@julie1013 You’ve got a syntax error.
The parentheses shouldn’t be there.
EDIT: Just noticed this was over a year ago.