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

Created on 7 Mar 2019  路  24Comments  路  Source: gridsome/gridsome

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
bug

Most helpful comment

[email protected] 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"
  }
}

All 24 comments

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

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

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

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.

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 ;)

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

Here's a hint: https://github.com/nodejs/node/issues/21685#issuecomment-408898443

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.

[email protected] 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"
  }
}

For those using NPM: npm install [email protected] --save

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

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

I've tried npm install [email protected] 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 ?

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.

Folks, note that this is being fixed in Jest, a PR was just opened: https://github.com/facebook/jest/pull/8083. Thanks @willdante and @hjvedvik for reporting it there 馃憤

@willdante Please use npm install [email protected] --save
The issue is solved with the command.

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 ?

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

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 馃槷.

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 (?!)

Not working for me 馃槩, but npm install [email protected] --save works.

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.

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

The fix is not part of the 24.3.1 release.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jonarod picture Jonarod  路  21Comments

aligajani picture aligajani  路  45Comments

tyankatsu0105 picture tyankatsu0105  路  22Comments

Js-Brecht picture Js-Brecht  路  26Comments

physcocode picture physcocode  路  26Comments