error when run in node 12
See original GitHub issueconst Koa = require('koa');
const KoaRouter = require('koa-router');
const app = new Koa();
const router = new KoaRouter();
module.exports = class HttpServer {
start() {
router.get('/a', async ctx => {
ctx.body = 'a';
});
router.get('/b', async ctx => {
ctx.body = 'b';
});
router.get('/c', async ctx => {
ctx.body = 'c';
});
router.get('/d', async ctx => {
ctx.body = 'd';
});
app.use(router.routes()).use(router.allowedMethods());
app.listen(3000);
}
};
it raise libc++abi.dylib: terminating with uncaught exception of type std::out_of_range: vector when compile and run in node 12 with mac 10.14 (bytenode -c app.js && bytenode app.jsc) but it is ok when compile and run in node 10
change the code to
const Koa = require('koa');
const KoaRouter = require('koa-router');
const app = new Koa();
const router = new KoaRouter();
module.exports = class HttpServer {
start() {
router.get('/a', async ctx => {
ctx.body = 'a';
});
router.get('/b', async ctx => {
ctx.body = 'b';
});
router.get('/c', async ctx => {
ctx.body = 'c';
});
// router.get('/d', async ctx => {
// ctx.body = 'd';
// });
app.use(router.routes()).use(router.allowedMethods());
app.listen(3000);
}
};
it is ok compile and run in node 12
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
15 Common Error Codes in Node.js and How to Fix Them
10. ENOENT ... This error is a straightforward one. It means "Error No Entity" and is raised when a specified path (file or...
Read more >Errors | Node.js v19.3.0 Documentation
Node.js generates system errors when exceptions occur within its runtime environment. These usually occur when an application violates an operating system ...
Read more >Error installing nodejs version 12 on alpine linux
In your case, nodejs 12.x package already exists so You should install nodejs if you want to install an older version instead of...
Read more >ts-node - npm
This error is thrown by node when a module is require() d, but node believes it should execute as native ESM. This can...
Read more >Syntax error not showing in stderr with `node --inspect-brk` in ...
HI, I'm trying a simple script with a syntax error in it but I'm not getting the error displayed when running with node...
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
Cool, it works now. thank you!
I guess I found it. V8 api was changed again. Compare this with this.
This indeed can be fixed in Bytenode.
Thank you for your report.