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

require() of ES Module error in hh test #202

Open
dashDebasis123 opened this issue Jan 30, 2024 · 3 comments
Open

require() of ES Module error in hh test #202

dashDebasis123 opened this issue Jan 30, 2024 · 3 comments

Comments

@dashDebasis123
Copy link

I got this error while testing the smart contract. Please help me out.

@PatrickAlphaC

image

@borailci
Copy link

borailci commented Feb 4, 2024

What is your Chai version?
I had the same error, and when I checked my chai version, I saw that it is above 5. I guess Chai versions above 5 does not support require("chai").
Can you try to downgrade your Chai if it is above 5?
You can use :
yarn add --dev [email protected]

@cromewar
Copy link

cromewar commented Feb 9, 2024

@dashDebasis123 Were you able to solve this?

@rocco1226
Copy link

rocco1226 commented Feb 17, 2024

Chai seems to be updated to ES Modules, which using import() instead of require().
And I did some searches. And the information indicated that ES Modules is the future module system of Node.js and brower. However, it is seemingly not recommended that using both ES Modules and CommonJS Modules. You can use some old versions chai just for study.

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

4 participants