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

Error running 'gridsome develop' on fresh project; Error: stderr is null #252

Closed
wjustice opened this issue Mar 7, 2019 · 24 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@wjustice
Copy link

wjustice commented Mar 7, 2019

Description

Tried to run develop on a newly created project. Fails after Bootstrap step.

Steps to reproduce

> gridsome create hello-gridsome
> cd hello-gridsome
> gridsome develop

Console output

Gridsome v0.5.4

Initialize - 0.18s
Load sources - 0.04s
Create GraphQL schema - 0.04sSet up routes - 0s
Generate code - 0.04s
Bootstrap finish - 0.31s
Error: stderr is null - this should never happen. Please open up an issue at https://github.com/facebook/jest
    at ChildProcessWorker.getStderr (/Users/williamjustice/workspace/gridsome-test/node_modules/jest-worker/build/workers/ChildProcessWorker.js:222:13)
    at new BaseWorkerPool (/Users/williamjustice/workspace/gridsome-test/node_modules/jest-worker/build/base/BaseWorkerPool.js:69:35)
    at new WorkerPool (/Users/williamjustice/workspace/gridsome-test/node_modules/jest-worker/build/WorkerPool.js:31:1)
    at new JestWorker (/Users/williamjustice/workspace/gridsome-test/node_modules/jest-worker/build/index.js:123:26)
    at createWorker (/Users/williamjustice/workspace/gridsome-test/node_modules/gridsome/lib/workers/index.js:9:10)
    at module.exports (/Users/williamjustice/workspace/gridsome-test/node_modules/gridsome/lib/server/middlewares/assets.js:8:18)
    at module.exports (/Users/williamjustice/workspace/gridsome-test/node_modules/gridsome/lib/server/createExpressServer.js:59:55)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Environment


- gridsome version: 0.5.4
- @gridsome/cli version: 0.0.8

- Node version: 10.13.0
- Platform: Mac
@robaxelsen robaxelsen added the bug Something isn't working label Mar 7, 2019
@a18t
Copy link

a18t commented Mar 7, 2019

Were you using a starter kit?

I just had the same error using the starter kit here https://github.com/gridsome/gridsome-starter-markdown-blog.git

Using https://github.com/gridsome/gridsome-starter-blog.git instead worked fine

@marcfilleul
Copy link

Hi,
Same error here on Windows OS with default starter.
The bug appeared some hours ago only.

@dj3plles
Copy link

dj3plles commented Mar 7, 2019

I got the same error from a fresh install.
I'm on Ubuntu platform

@cossssmin
Copy link
Member

Confirmed not only with the default starter, but with another one that I just recently launched. It's not about the starters, looks like a dependency (Jest) is causing it to fail. Tested on Win10/Git Bash.

@marcfilleul
Copy link

Yes indeed, the error is clear about that : Please open up an issue at https://github.com/facebook/jest

But I'm not a dev and don't even knew Jest before today so I hope we'll have a comprehensive answer here ;)

@Berkmann18
Copy link

Just ran into that issue following this tutorial using Ubuntu on Windows.

@andreipopovici
Copy link

andreipopovici commented Mar 7, 2019

Here's a hint: nodejs/node#21685 (comment)

Not sure if adding that to https://github.com/gridsome/gridsome/blob/master/gridsome/lib/server/middlewares/assets.js#L55 would help, but it does seem like something internal to gridsome, not just jest-worker.

@hjvedvik
Copy link
Member

hjvedvik commented Mar 7, 2019

jest-worker@24.3.0 was published just before this issue was created. I'll see if we can do something in Gridsome to fix this. A temporary solution is to use a previous version by adding this to package.json if you use Yarn:

{
  "resolutions": {
    "gridsome/jest-worker": "24.0.0"
  }
}

@coffeepostal
Copy link

coffeepostal commented Mar 8, 2019

For those using NPM: npm install jest-worker@24.0.0 --save

Edit: added --save, sorry, I should have included that initially.

@petar7777
Copy link

Perfect. Guys.
This issue is solved on my local.
Thanks

@marcfilleul
Copy link

I've tried npm install jest-worker@24.0.0 as I've had installed Gridsome CLI with NPM and it didn't work.

Then I've uninstalled Gridsome CLI with NPM and installed it with Yarn to try to add
"resolutions": { "gridsome/jest-worker": "24.0.0" }
to my package.json but it didn't work better.

I'm not a dev and definitely a beginner so what am I doing wrong here ?

@Berkmann18
Copy link

Berkmann18 commented Mar 8, 2019

I tried @coffeepostal' suggestion but got an Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin' even after running this bash script (clean re-install of the node dependencies).

I then ran npm i webpack; gridsome develop and it worked.

@cossssmin
Copy link
Member

Folks, note that this is being fixed in Jest, a PR was just opened: jestjs/jest#8083. Thanks @willdante and @hjvedvik for reporting it there 👍

@petar7777
Copy link

petar7777 commented Mar 8, 2019

@willdante Please use npm install jest-worker@24.0.0 --save
The issue is solved with the command.

@marcfilleul
Copy link

Thank you @petar7777, it worked perfectly !

@ALL: Since Jest fix has been merged, I was expecting to be able to run gridsome develop without issue after a fresh install.
But I've just tried it and still got the error, is it normal ?

@cossssmin
Copy link
Member

@willdante they haven't tagged a release yet so you're still using v24.3.1 which had the bug :)

@marcfilleul
Copy link

Thanks for the precision @cossssmin .
I'm totally new to a lot of dev stuff as I was only working on Wordpress front-end webdesign for 10 years.

I'm ready to improve my game and start moving to more modern web development solutions but it comes with many new concepts to learn, including basic ones around github 😮.

@cossssmin
Copy link
Member

No worries 🙂

Until they tag a new release, I tried this and it seems I can get it working. Not sure why, so if anyone else can confirm:

  1. Install a starter - I'll use mine:

    gridsome create test-bleda https://github.com/cossssmin/gridsome-starter-bleda
  2. cd test-bleda && gridsome develop -> you should get the error

  3. npm install -> basically re-install dependencies. It should say it added 115 packages (?!)

  4. gridsome develop -> now it works (?!)

@marcfilleul
Copy link

Not working for me 😢, but npm install jest-worker@24.0.0 --save works.

@msgeissler
Copy link

Especially for the beginners: Don't forget to remove the dependency to the explicit patch level again after the fix has been released, so you are not stuck with the old version. Otherwise you might run into other problems later on.

Just remove the line from package.json or use the same command, but with uninstall instead of install.

@hjvedvik
Copy link
Member

hjvedvik commented Mar 8, 2019

I published a new version of Gridsome (0.5.5) with a pinned jest-worker version that works.

@Berkmann18
Copy link

jestjs/jest#8083 got merged and jest-worker@24.3.1 has been released.

@msgeissler
Copy link

The fix is not part of the 24.3.1 release.

@Berkmann18
Copy link

@msgeissler Indeed, it's in the master branch which is failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests