rrdelaney / reason-scripts

:beginner: Create a ReasonML and React development environment
MIT License
628 stars 58 forks source link

Test Not Running Immediate After create-app #68

Closed rayk closed 5 years ago

rayk commented 6 years ago

PROBLEM Running yarn test immediate aftering creating a new ReactReason app, generates the following errors.

Case 1

Install with the following

yarn create react-app my-app --scripts-version reason-scripts

results in:

yarn run v1.7.0
$ react-scripts test --env=jsdom --verbose
2018-07-02 16:02 node[7962] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2018-07-02 16:03 node[7962] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2018-07-02 16:03 node[7962] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:120:28)
Emitted 'error' event at:
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:126:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Case 2

All tried to recreate using next version:

yarn create react-app my-next-app --scripts-version reason-scripts@next

results in:

018-07-02 16:14 node[10727] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2018-07-02 16:14 node[10727] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:120:28)
Emitted 'error' event at:
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:126:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

There appears to be no other problems, build is working, dev server is good. I do suspect this issue is related to an upstream issue in create-react-app. Installing watchman does appear to fix the problem on new installs, yet this is not a universal solution, I managed to recreate the above in a project that had a number (25) test files.

Hope the report helps.

ENV

chen4w commented 6 years ago

https://github.com/facebook/create-react-app/issues/4540

rrdelaney commented 5 years ago

Tests are pretty broken in reason-scripts, there's no expected fix.