-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Looks like this line is problematic:
const chalk = new Chalk({ level: 3 }); |
aws-sdk-client-mock: 4.1.0
aws-sdk-client-mock-jest: 4.1.0
Replacing with:
import { Instance } from 'chalk';
const chalk = new Instance({ level: 3 });
seems to fix it. I can open a PR if you're happy with this change 👍
travi, piersroberts, josh-burton, ben-eb, sambunting and 11 more
Activity
m-radzikowski commentedon Oct 25, 2024
Hey, can you provide a repro details when you encounter this issue?
slcp commentedon Oct 25, 2024
I saw the same behaviour and I have resolved this issue by installing
chalk 5.3.0
(just latest at the time) as a dev dependency of my project (not ideal).I can see that
chalk
is installed in the jest matcher package as a devDependency, is that intentional? It isn't being declared as a dependency of the installed package which maybe it should be? And if there is another version ofchalk
around (I think that was where my issue was) unexpected behaviour like this issue describes might be seen.travi commentedon Oct 25, 2024
i just ran into this issue as well and agree that making
chalk
a prod dependency instead of a dev-dependency is the correct fix if the use of chalk is needed thereEHadoux commentedon Oct 25, 2024
Yeah sorry, my initial post could have been better. The solution is indeed to have the latest version of chalk and not to change the code to comply with a previous version as suggested in my initial post.
cawofeso commentedon Nov 1, 2024
I am also facing this problem as well so created a pr to move chalk as a dependency instead of a dev dependency
@m-radzikowski if you could take a look that would be great
alexbaileyuk commentedon Nov 11, 2024
Same issue here today. For now have installed
chalk 5.3.0
as a dev dependency in my project. Unfortunately that did not solve the problem for me.I've tried importing in different orders and re-installing node_modules with no success.
Would be great to get this PR merged to remove the issue.
bluefeet commentedon May 20, 2025
After running
npm i -D chalk
to get the latest version installed I found thatnpm ls chalk
still showed v4, so I had to add this to mypackage.json
:Then
npm i
thennpm ls chalk
showed v5 and things seem to be working.Curious, is this library still being maintained? Seeing these open issues sitting around for half a year makes me uneasy.
EHadoux commentedon Jun 26, 2025
Sorry to ping again but can we perhaps get this sorted @m-radzikowski ? The PR looks ready to go #244