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

truffle test: Error: Cannot find module 'babel-runtime/core-js/object/entries' #5074

Closed
1 task done
dibi91 opened this issue May 3, 2022 · 12 comments
Closed
1 task done

Comments

@dibi91
Copy link

dibi91 commented May 3, 2022


Issue

truffle test command exception

Steps to Reproduce

Create a simple truffle project and launch test:

  1. truffle init
  2. truffle create contract TestBabelRuntimeException
  3. truffle create test TestBabelRuntimeException
  4. truffle test

Expected Behavior

Tests should be executed.

Actual Results

Test command return an exception: Error: Cannot find module 'babel-runtime/core-js/object/entries

Screenshot from 2022-05-03 16-15-58

Environment

  • Operating System: ubuntu 20.04
  • Ethereum client: ganache-cli
  • Truffle version (truffle version): 5.5.12
  • node version (node --version): 16.15.0
  • npm version (npm --version): 8.5.5

Additional infos

test command work as expected with 4.1.17 version, tried also v5.4.33 and got error too.

@hickscorp
Copy link

Having the same error when using the debug 0x... from the truffle console...

@athenayay
Copy link

This is due to the latest update - https://www.npmjs.com/package/truffle

is there a way to revert back to old version :)

A

@ngochiencse
Copy link

Me too. It seems to be wrong linking with package babel runtime.
Fortunately you can temporary fix this problem by running the following command:
npm install -g babel-runtime
In the meantime, we should fix this problem or at least update the documentation immediately.

@zj95120
Copy link

zj95120 commented May 4, 2022

same problem

@YashNagiReddy7
Copy link

After a bit of continued testing it seems like you'll want to use truffle v5.1.39 as I was able to get that version to work, so you'll want to do:
<npm uninstall -g truffle>
<npm install -g truffle@5.1.39>

@dibi91
Copy link
Author

dibi91 commented May 4, 2022

After a bit of continued testing it seems like you'll want to use truffle v5.1.39 as I was able to get that version to work, so you'll want to do: <npm uninstall -g truffle> <npm install -g truffle@5.1.39>

Nope, that version didn't work too.
Installed babel runtime globally as @ngochiencse suggested, work as a workaround.

@cds-amal
Copy link
Member

cds-amal commented May 4, 2022

Thanks for raising this @dibi91 !

I've confirmed the behavior on Ubuntu (20.04)/Truffle v5.5.12. We recently updated a dependency that should fix this in the next release. See screencast.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.4 LTS
Release:	20.04
Codename:	focal

@ngochiencse
Copy link

It worked!

@haltman-at
Copy link
Contributor

OK, can people try this again with Truffle 5.5.13? Thanks!

@SebGazeau
Copy link

With 5.5.13 it works for me !

@cds-amal
Copy link
Member

cds-amal commented May 9, 2022

@dibi91 can you confirm Truffle v5.5.13 resolves the issue?

@dibi91
Copy link
Author

dibi91 commented May 9, 2022

@dibi91 can you confirm Truffle v5.5.13 resolves the issue?

Yes, it's working perfectly! Thank you!

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

No branches or pull requests

9 participants