Comments (8)
This is a bug in V8 with tail call optimization. The --harmony-tailcalls
flag (implied by --harmony
) is enough to trigger it. It will probably not be fixed in Node.js because the feature is not considered stable in V8 5.1.
I suggest you drop the --harmony
flag and if you really need one of the features that it activates, enable it directly. Here is the list: https://github.com/nodejs/node/blob/v6.5.0/deps/v8/src/flag-definitions.h#L211-L216
from convert.
Did some more testing. Its due to the --harmony
flag that I am including when running node.
Smallest failing test case:
const Koa = require('koa')
const convert = require('koa-convert')
const session = require('koa-generic-session')
const app = new Koa()
app.use(convert(session()))
app.listen(3000)
Running node --harmony index.js
then hitting localhost:3000 in a webbrowser returns a 500 instead of the expected 404.
Running without the harmony flag works as expected.
from convert.
Adding @targos
from convert.
Which version do you use ? (for koa, koa-convert & koa-generic-session)
from convert.
Ah, good question. I should have mentioned it in my original post.
Koa: 2.0.0
Koa-convert: 1.2.0
Koa-generic-session: 1.11.3
from convert.
Thanks for the detailed report. The stacktrace looks a little bit strange. It basically says that calling generator.next()
will return undefined
instead of { done, result }
protocol. I think it's more likely to be a nodejs/V8 bug.
Also, --harmony
flag is usually not suitable for production.
from convert.
Thanks everyone. I removed the harmony flag and my app works fine. Looks like the only reason why I had it was due to needing it back in the old node 0.12.x to get generators, arrow functions, promises, block scoping, etc.
from convert.
Closing as its a bug in V8
from convert.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from convert.