-
-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logger.replace
in cjs yarn monorepo doesn't work if called from another package
#1548
Comments
cc @Andarist - This is caused by dual-package hazard, even though effect is built with preconstruct (at the moment). What happens here is that we forgot to define loggers as global so two instance of defaultLogger are created and replace doesn't work, we can fix it by using a global for loggers but it's strange because this should not occur in the first place. Maybe vitest prefers the pure modules and ignores the esm proxy modules? |
Vitest is using some weird strategy of bundling/resolving some things on its own but yet leaving some other things for node to resolve. I didn't dig deep enough to know what exact heuristic they are using to do this (they use workers so call stacks are not that useful) but I'm pretty sure of that conclusion. I couldn't observe I think this should be reported to the Vite team regardless of how you decide to resolve it here. From my PoV, this is clearly an issue on their side. |
This is solved on our side, keeping it open as a reference to track vitest |
Confirming the problem resolved on my end after the effect update. Thanks! |
Upstream vitest closed the issue - I don't think there is any further action needed here? |
What version of Effect is running?
2.0.0-next.50
What steps can reproduce the bug?
When testing a cjs monorepo package using vitest, e.g.
Logger.replace
doesn't have any effect when it's being called from a different package than the one being tested.Repro: https://github.com/sukovanej/effect-cjs-yarn-monorepo-repro/
What is the expected behavior?
combinators manipulating fiber refs can be defined in different cjs packages and used with vitest
What do you see instead?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: