Create-react-app: E2E test fails in Docker locally due to missing "libelf.so.1"

Created on 28 Jun 2017  Â·  11Comments  Â·  Source: facebook/create-react-app

Is this a bug report?

Yes.

Can you also reproduce the problem with npm 4.x?

I can reproduce in v3.10.3 and v4.6.1.

Which terms did you search for in User Guide?

"e2e", "docker", "libelf"

Environment

  1. node -v: v6.3.1
  2. npm -v: 4.6.1
  3. create-react-app version: commit 7796c94

Then, specify:

  1. Operating system: Mac OS X v10.12.5
  2. Docker version: 17.06.0-ce-mac18

Steps to Reproduce

  1. Clone create-react-app from master
  2. Run npm install
  3. Run npm e2e:docker

Expected Behavior

The end-to-end test script should run in Docker and pass.

Actual Behavior

After running for a while, the test script exits with this error message:

> [email protected] test /home/node/create-react-app/packages/react-error-overlay
> flow && jest

/home/node/create-react-app/packages/react-error-overlay/node_modules/flow-bin/flow-linux64-v0.46.0/flow: error while loading shared libraries: libelf.so.1: cannot open shared object file: No such file or directory
npm info lifecycle [email protected]~test: Failed to exec test script
npm ERR! Test failed.  See above for more details.
++ set +x
e2e-simple.sh: ERROR! An error was encountered executing line 132.
Cleaning up.
Exiting with error.

✘ Job failes
✨  Done in 119.36s.

Most helpful comment

This issue is tracked in https://github.com/nodejs/docker-node/pull/363, I believe upgrading flow to 0.48.0 in react-error-overlay will fix this. It's still uses 0.46.0

All 11 comments

cc @EnoahNetzach

Just to be clear—you're trying to contribute to CRA, right?

Specifically I'm trying to fork the repository (I've forked the repo before, but that was before it became a monorepo with lerna and I've fallen way behind since then). But yes, this is from cloning the repo to start working on the tool itself rather than building an app with it.

@dallonf do you incur in the same error by simply running a docker container?
E.g. docker run -ti node:7 bash

Anyway, to be super sure it's a CRA problem, try cleaning docker images, cloning CRA again and reinstalling docker (eventually).

Also, I don't see version 17.06.0-ce-mac18 in the release notes, maybe it has to do with the way you installed it?

I can't check this issue out on my Mac atm, but I'll be back soon.

Uh, the problem should be this one https://github.com/flowtype/flow-bin/issues/26.

It never happened to me 😵
What I don't get is that Travis uses the same docker images as we do..

docker run -ti node:7 bash does seem to get me into a bash prompt just fine; I can also pull up a Node REPL from within the container and run a couple of console.logs without issue.
Regarding the Docker version, it just ran an auto-update today. Maybe they haven't had a chance to update the release notes yet?

Thanks for looking into this! Do you think I could create a PR to fix this by adding that apt-get bit into the Dockerfile?

FWIW, I run into this too:

> [email protected] test /home/node/create-react-app/packages/react-error-overlay
> flow && jest

/home/node/create-react-app/packages/react-error-overlay/node_modules/flow-bin/flow-linux64-v0.46.0/flow: erro
r while loading shared libraries: libelf.so.1: cannot open shared object file: No such file or directory
npm info lifecycle [email protected]~test: Failed to exec test script
npm ERR! Test failed.  See above for more details.
++ set +x
e2e-simple.sh: ERROR! An error was encountered executing line 132.
Cleaning up.
Exiting with error.

✘ Job failes
Done in 176.24s.

CRA doesn't have a Dockerfile, it uses the official one, but maybe you could try to run docker as before, init an empty npm package and add flow, so to test if that's really what's causing it?

BTW, I just received the 17.06.0-ce-mac18 update!

This issue is tracked in https://github.com/nodejs/docker-node/pull/363, I believe upgrading flow to 0.48.0 in react-error-overlay will fix this. It's still uses 0.46.0

I can confirm this fix works! Thank you 🎉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ap13p picture ap13p  Â·  3Comments

fson picture fson  Â·  3Comments

wereHamster picture wereHamster  Â·  3Comments

adrice727 picture adrice727  Â·  3Comments

AlexeyRyashencev picture AlexeyRyashencev  Â·  3Comments