Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Problem running test from truffle develop #2463

Closed
eggplantzzz opened this issue Oct 16, 2019 · 16 comments
Closed

Problem running test from truffle develop #2463

eggplantzzz opened this issue Oct 16, 2019 · 16 comments
Assignees

Comments

@eggplantzzz
Copy link
Contributor

Issue

truffle test fails when run from truffle develop

Steps to Reproduce

  1. In a new directory, run truffle unbox metacoin
  2. After unboxing, run truffle develop
  3. When the prompt appears, run test

Expected Behavior

I expect the tests to run

Actual Results

TypeError [ERR_INVALID_REPL_INPUT]: Listeners for `uncaughtException` cannot be used in the REPL
    at process.<anonymous> (repl.js:224:15)
    at process.emit (events.js:215:7)
    at process.emit (/Users/tyler/.nvm/versions/node/v12.11.0/lib/node_modules/truffle/build/webpack:/~/source-map-support/source-map-support.js:465:1)
    at _addListener (events.js:236:14)
    at process.addListener (events.js:284:10)
    at Runner.run (/Users/tyler/.nvm/versions/node/v12.11.0/lib/node_modules/truffle/node_modules/mocha/lib/runner.js:868:11)
    at Mocha.run (/Users/tyler/.nvm/versions/node/v12.11.0/lib/node_modules/truffle/node_modules/mocha/lib/mocha.js:612:17)
    at /Users/tyler/.nvm/versions/node/v12.11.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/test.js:116:1
    at new Promise (<anonymous>)
    at Object.run (/Users/tyler/.nvm/versions/node/v12.11.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/test.js:115:1)

Environment

  • Operating System: Mac OS
  • Ethereum client: truffle develop
  • Truffle version (truffle version): 5.0.40
  • node version (node --version): 12
  • npm version (npm --version): 6
@eggplantzzz
Copy link
Contributor Author

This bug is specific to Node 12 and is present in 5.0.39 and 5.0.38.

@eggplantzzz
Copy link
Contributor Author

Looks like it was referenced by David Burela here #2070

@ghost
Copy link

ghost commented Jun 9, 2020

hello there, im having the same issue with Truffle v5.1.28, same behavior, just clarify the bug is present not only in 5.0.38 and 5.0.39.

Just made a fresh instalation following those steps, all works fine but the test command :) https://www.trufflesuite.com/boxes/drizzle

bests :)


carlos@carlos-linux-machine:~/desarrollo/sc1-ethereum-rinkeby/app$ truffle version
Truffle v5.1.28 (core: 5.1.28)
Solidity v0.5.16 (solc-js)
Node v12.18.0
Web3.js v1.2.1


`truffle(develop)> test
Using network 'develop'.

Compiling your contracts...

Compiling ./test/TestSimpleStorage.sol
Artifacts written to /tmp/test-202059-9170-1ypjpj2.6mm6
Compiled successfully using:

  • solc: 0.5.16+commit.9c3226ce.Emscripten.clang

TypeError [ERR_INVALID_REPL_INPUT]: Listeners for uncaughtException cannot be used in the REPL
at process. (repl.js:256:15)
at process.emit (events.js:327:22)
at process.emit (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/source-map-support/source-map-support.js:495:1)
at processEmit (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/signal-exit/index.js:155:1)
at process.emit (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/reselect-tree/node_modules/source-map-support/source-map-support.js:485:1)
at _addListener (events.js:358:14)
at process.addListener (events.js:406:10)
at Runner.run (/usr/local/lib/node_modules/truffle/node_modules/mocha/lib/runner.js:868:11)
at Mocha.run (/usr/local/lib/node_modules/truffle/node_modules/mocha/lib/mocha.js:612:17)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/test.js:159:1
at new Promise ()
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/test.js:158:1)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
truffle(develop)>`

@fainashalts
Copy link
Contributor

I just tested this in Truffle v5.1.31 and truffle test does work in this newest version. @eggplantzzz or @spore-engineering can you confirm? Thanks!

@CruzMolina
Copy link
Contributor

CruzMolina commented Jun 25, 2020

@fainashalts did you make sure to test using Node 12?

Running the test command within truffle develop using Node versions >= 12.3.0 should fail and throw the reported error.

@fainashalts
Copy link
Contributor

@CruzMolina I thought I had changed my node version but turns out it was still running v10. You are right, this error does happen on >= 12.3.0! Sorry for the confusion!

@CruzMolina
Copy link
Contributor

CruzMolina commented Jun 26, 2020

Directly related to mochajs/mocha#4009.

Would love more beta testers of our experimental release! #2070 (comment):

Hey everyone! ✋

We just published an experimental prerelease that uses a fork of mocha with one tiny change. 🤞

Our node 12 CI appears to be pleased and smoke testing locally w/ node 12 LTS seems to be fine.

Please give it a try and let us know if things work!

npm un -g truffle
npm i -g truffle@nodeLTS

@eggplantzzz
Copy link
Contributor Author

Linking this PR because it may fix this issue. #3146

@CruzMolina
Copy link
Contributor

Unfortunately, #3146 does not resolve this issue ☹️ #3146 (review)

@Yeleboh
Copy link

Yeleboh commented Aug 31, 2020

Hi Guys,

am running these versions and am getting the above error.

Truffle v5.1.35 (core: 5.1.35)
Solidity v0.5.16 (solc-js)
Node v12.18.2
Web3.js v1.2.1

Any recommendations?

@Yeleboh
Copy link

Yeleboh commented Aug 31, 2020

Screen Shot 2020-08-31 at 3 31 40 PM

See!!

@fainashalts
Copy link
Contributor

@Yeleboh we have been working on a fix for this and I'm hoping it will be in this week's release! I'll post here with an update once that is the case. Thanks!

@Yeleboh
Copy link

Yeleboh commented Sep 1, 2020

@fainashalts Thank you Faina for your reply. I look forward to this fix. However, if I reverted to earlier version of truffle, could this be a temporary fix until this week's release is out?

@eggplantzzz
Copy link
Contributor Author

@Yeleboh If you downgrade Node to version 10 it should work.

@rafarodra
Copy link

@fainashalts Please please tell us when this is s updated. I'm having the same issue.

@haltman-at
Copy link
Contributor

OK, this should be fixed now!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants