Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation needs to be fixed #730

Open
ankush17star opened this issue Jan 29, 2019 · 4 comments
Open

Documentation needs to be fixed #730

ankush17star opened this issue Jan 29, 2019 · 4 comments

Comments

@ankush17star
Copy link

ankush17star commented Jan 29, 2019

The Getting Started guide is very misleading right at the beginning of one of the steps: http://alt.js.org/guide/actions/

Apparently, classes are not supported natively and only ES5 style works

This kind of unexpected result may put off some new users

If you run the exact code on the webpage (and there's not a whole lot to it), it returns:

TypeError: Class constructor LocationActions cannot be invoked without 'new'
    at new ActionsGenerator (<path>/node_modules/alt/lib/index.js:187:72)
    at Alt.createActions (<path>/node_modules/alt/lib/index.js:211:28)
    at Object.<anonymous> (<path>/actions/locations.js:9:22)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)

It needs to say that the ES6 classes need to be transpiled into the ES5 format''

Granted that happens automatically in the build tools, but for first-timers, things appear broken (if we run them without transpiling)

@3dfoster
Copy link

3dfoster commented Aug 7, 2019

I went through this issue going through the getting started guide and I don't know how to fix it

@3dfoster
Copy link

3dfoster commented Aug 8, 2019

Hey @ankush17star

Thanks, I tried that but it's getting hung up on the line module.exports = alt.createActions(LocationActions); in LocationActions.js, throwing the error × TypeError: Class constructor LocationStore cannot be invoked without 'new'.

@ankush17star
Copy link
Author

@fasterthan Can you share your code sample here please? I'll take a look and get back to you

@maheshambiga
Copy link

I am still getting the below error though I am using babel to transpire.
TypeError: Class constructor TodoActions cannot be invoked without 'new'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants