Skip to content

Can't use ES6 default variables with create-react-app? SOLVED #512

Closed
@richb-hanover

Description

@richb-hanover

I have a working piece of code that I want to port to a create-react-app project, and stumbled over the compile error below for my server-side. Am I missing something?

...
> server-api@ server /Users/richb/github/cloudmu-react-redux-starter-kit/server
> node server.js

/Users/richb/github/cloudmu-react-redux-starter-kit/server/utils/protocol.js:683
  function bump(stat, amount=1) {
                            ^
SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
...

[I also had to add "use strict"; to the head of the file to get farther....]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions