Initial issues when cloning the repo
mlesk opened this issue · comments
I cloned the repo and ran into the following problems getting things running, all house cleaning stuff:
- 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',
},
-
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.
-
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
-
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.
Still having the following problems with this fix merged:
- 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.
Yes, patch solved it. V8 does as well. Thanks