kriasoft / react-firebase-starter

Boilerplate (seed) project for creating web apps with React.js, GraphQL.js and Relay

Home Page:https://firebase.reactstarter.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Initial issues when cloning the repo

mlesk opened this issue · comments

commented

I cloned the repo and ran into the following problems getting things running, all house cleaning stuff:

  1. When using VSCode with format on save enabled, because prettier is configured via .eslintrc with trailingComma set to 'all', this results in the function call file=path.resolve in setup.js to be formatted with a trailing comma which is not supported before ES7. FIxed this by changing the confuration from 'all' to 'es5'
'prettier/prettier': [
      'error',
      {
        singleQuote: true,
        trailingComma: 'es5',
      },
  1. node-fetch is a required dependency from setup.js but is not listed in package.json in the dependencies. Fixed by adding node-fetch as a depenency.

  2. Tests are not found because they are located in the test directory which is not in the src directory. react-scripts expects all tests to be located in the src directory. Fixed by moving the test directory into the src directory

  3. chai is a required dependency from spec.js but is not listed as a dev dependency. Fixed by adding chai as a dev dependency.

Once I made these tweaks everything seems to be working fine. Thanks for putting this package together, love that I can use relay modern without having to eject from create-react-app.

@mlesk thanks, much appreciated! If you like, you can fetch and merge this fix into your project:

git remote add react-static-boilerplate https://github.com/kriasoft/react-static-boilerplate.git
git checkout master
git merge react-static-boilerplate/master
commented

Still having the following problems with this fix merged:

  1. trailing comma in setup.js line 37, removing this comma and setting trailing comma prettier option to es5 prevents this from happening.

yarn relay v0.27.5
$ node setup --download-schema && relay-compiler --src ./src --schema ./src/schema.graphql
/Volumes/Data/Dev/projects/current/x/setup.js:38
);
^
SyntaxError: Unexpected token )
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:423:7)
at startup (bootstrap_node.js:147:9)
error Command failed with exit code 1.

@mlesk thanks, fixed in a5b0b8a Still, you may want to use Node v8+ to avoid this issue altogether.

commented

Yes, patch solved it. V8 does as well. Thanks