Open jkcom opened 9 years ago
Let me look into it
This looks like a babel issue off the bat. I don't mind publishing an ES6 strict version of alt but I don't think that's the right solutions.
Thank you for your quick reply.
My goal is to run the iojs server without any cross compiler (https://iojs.org/en/es6.html). So from what I understand when it fails on the server it is not run through babel at all. But it very likely have something to do with the strict-mode of the class.
Maybe a setup like this is a bit premature.. but as far as i can tell the specification states use of class require strict mode.. or am i missing something?
Thanks, and by the way.. this framework is an absolute pleasure to work with.
Alt is transpiled by babel into es5 code. You're most likely running that on the server.
True, that was the issue.. I was able to solve it by wrapping my server application in a bable module loader/transpiler to transpile to es5 during runtime. Now I only need to fix the same problem with the jest test-runner but that is another thing.. Thanks for helping out. Best, Josef
reopen?
Broken behavior: https://gist.github.com/goatslacker/c0c1bccc3ea5224f5bd8
Apparently you can't derive a "native" class in babel.
Is there any update on this? We're also running into this same issue...
@krrg , we were having the same issue. It seems to arise when you do not reactify with es6. You have to let reactify know you are using es6.
For example, it works in his tutorial because he passed it with the flag --es6 when he goes to build:
browserify -t [reactify --es6] src/App.jsx > build/app.js
It works for us in our gulp file since we pass it like so: browserify(p.jsx) .transform('reactify', {stripTypes: true, es6: true}) .bundle()
I have similar issues.
TypeError: Class constructors cannot be invoked without 'new'
at ActionsGenerator.FeedActions (/home/raziel/MyProjects/legion-media/isomorphic/build/server.js:463:2)
I think it is related to #604
I will take a look tomorrow.
Solution - import Alt from 'alt/src/index', instead from 'Alt' itself. If your Babel is configured not to translate classes to functions, then both your code and Alt implementation would be in class-like structure, and it should work fine.
In order for Babel to read the sources of Alt, you should add syntax-trailing-function-commas to the Babel plugins.
I tested this on the latest chrome, and it worked fine (before, it indeed failed with the 'new' error).
A full spec of what it took, say the packages.json and .babelrc would be nice. It is very frustrating banging on these until it works. Especially when also translating from browserify or others to webpack.
When trying to run server-side using io.js (2.3.3) using es6 classes i get the following error:
From a store in this format:
Is there some configuration that should be set for alt to know how initialisation should happen? Or could I be missing some other obvious thing?