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

Watcher failing to run on latest create-react-app (0.8.3) #41

Closed
billscheidel opened this issue Dec 10, 2016 · 9 comments
Closed

Watcher failing to run on latest create-react-app (0.8.3) #41

billscheidel opened this issue Dec 10, 2016 · 9 comments

Comments

@billscheidel
Copy link

I just installed the latest create-react-app and I can no longer get the watcher to run. I'm currently getting the following error in vscode:

fs.js:1431
    throw error;
    ^

Error: watch /home/bill/dev/react-client/node_modules/es5-ext/test/string/#/contains ENOSPC
    at exports._errnoException (util.js:1026:11)
    at FSWatcher.start (fs.js:1429:19)
    at Object.fs.watch (fs.js:1456:11)
    at NodeWatcher.watchdir (/home/bill/dev/react-client/node_modules/sane/src/node_watcher.js:144:20)
    at Walker.<anonymous> (/home/bill/dev/react-client/node_modules/sane/src/node_watcher.js:353:12)
    at emitTwo (events.js:106:13)
    at Walker.emit (events.js:191:7)
    at /home/bill/dev/react-client/node_modules/walker/lib/walker.js:69:16
    at go$readdir$cb (/home/bill/dev/react-client/node_modules/graceful-fs/graceful-fs.js:149:14)
    at FSReqWrap.oncomplete (fs.js:123:15)

All the tests are marked with empty green circles and indicate that tests haven't been run even though they have been.

@orta
Copy link
Member

orta commented Dec 21, 2016

interesting, so I've started looking into create-react support again now that we're at 2.x and sharing Jest code.

It looks like it will register the project still ( and open ) but doesn't do any of the dots.

screen shot 2016-12-21 at 10 37 35 am

My guess is that this is the new babel AST generate which isn't handling JSX (there's not a .babelrc to tell it to use JSX) perhaps I will need to add something specific to jest-editor-support to handle the case of create-react here

@marcodeltongo
Copy link

Hello, I'm not using CRA nor scripts but a setup with .babelrc and package.json jest section. The tests run in CLI and via this plugin in OUTPUT but I don't see dots, nearly identical to your screenshot. Can I do something to help on this ?

@orta
Copy link
Member

orta commented Jan 23, 2017

I've seen some instability there around the babelrc parsing/finding - can you run the command Open Developer Tools inside VS Code and see if there are any useful logs?

@kroniak
Copy link

kroniak commented Jan 24, 2017

I see other errors, jsx transformation does not work.
This is last CRA 0.8.3

FAIL  src\App.test.js

  ● Test suite failed to run

    SyntaxError: e:/workspaces/_templates/React/create-react-app/src/App.test.js: Unexpected token (7:18)
      5 | it('renders without crashing', () => {
      6 |   const div = document.createElement('div');
    > 7 |   ReactDOM.render(<App />, div);
        |                   ^
      8 | });
      9 | 
      
      at Parser.pp$5.raise (node_modules\babylon\lib\index.js:4333:13)
      at Parser.pp.unexpected (node_modules\babylon\lib\index.js:1705:8)
      at Parser.pp$3.parseExprAtom (node_modules\babylon\lib\index.js:3670:12)
      at Parser.pp$3.parseExprSubscripts (node_modules\babylon\lib\index.js:3414:19)
      at Parser.pp$3.parseMaybeUnary (node_modules\babylon\lib\index.js:3394:19)
      at Parser.pp$3.parseExprOps (node_modules\babylon\lib\index.js:3324:19)
      at Parser.pp$3.parseMaybeConditional (node_modules\babylon\lib\index.js:3301:19)
      at Parser.pp$3.parseMaybeAssign (node_modules\babylon\lib\index.js:3264:19)
      at Parser.pp$3.parseExprListItem (node_modules\babylon\lib\index.js:4190:16)
      at Parser.pp$3.parseCallExpressionArguments (node_modules\babylon\lib\index.js:3493:20)


Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        8.924s
Ran all test suites.

@orta
Copy link
Member

orta commented Jan 24, 2017

interesting, this sounds like your babelrc isn't being found, any chance you can clone this repo and run it and look at values inside node_modules/jest-editor-support/src/parsers/BabylonParser.js -> https://github.com/facebook/jest/blob/master/packages/jest-editor-support/src/parsers/BabylonParser.js#L53

@ryansully
Copy link

I got the same error as @kroniak using fresh install of CRA 0.8.5.

I noticed that CRA 0.8.5 is still using [email protected], which doesn't have jest-editor-support, because it was only introduced in 18.0.0. As a workaround, I manually updated jest to 18.0.0, and the test runner worked as expected.

Of course, this is not optimal, but is at most a temporary workaround until CRA releases 0.9.0, which updates jest to 18.1.0 as of now. The only alternative I can see until then would be to rollback vscode-jest to support 17.0.2, or otherwise check for various versions of jest and handle accordingly?

@orta
Copy link
Member

orta commented Feb 5, 2017

jest-editor-support comes with the vscode-extension rather than being installed through NPM, so it shouldn't be an issue to WRT coming from Jest in your node_modules.

I wonder if we just accidentally broke jest 17 support somehow?

@ryansully
Copy link

ryansully commented Feb 5, 2017

That's possible, since jest 17 doesn't even use jest-editor-support, so any logic written with jest-editor-support in mind and as a dependency potentially ignores how jest worked before 18.

@seanpoulter
Copy link
Member

Closing this issue since the extension now displays a message that it relies on Jest 20+, and despite the using create-react-app with react-scripts 0.8.3 and Jest 17.0.2 it still worked OK.

image

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

6 participants