Closed ghiscoding closed 9 months ago
Start a new pull request in StackBlitz Codeflow.
@sheremet-va Thanks for looking into this, however when running Stackblitz on Chrome with v0.33.0 (which is supposed to include the fix), I have the same error as before
TypeError: Method Promise.prototype.then called on incompatible receiver [object Module]
while running Stackblitz on Firefox end up with a different error
TypeError: Promise.prototype.then called on incompatible Proxy
So that doesn't help with my original issue on the Lerna-Lite project, note again that the previous version of conventional-changelog-angular
doesn't have this problem but they're using the Q library instead of Promises so that's probably why.
are there extra steps that I need to do in order for this basic unit test to pass?
here's the updated Stackblitz to Vitest v0.33.0 https://stackblitz.com/edit/vitest-dev-vitest-conventional-71ykal
For your case, you can just disable deps.interopDefault
. But I will look into it more
Thanks for the quick hack, that did the trick and I can confirm that it works in this Lerna-Lite PR 666... I wonder if I should merge it though since 666
is the number of the beast (demon) 👿 haha
Describe the bug
Calling
await import('conventional-changelog-angular')
works fine in real world usage, that is in Lerna-Lite, but throws an error when running unit test with Vitest. I have Renovate running once a week on the repo, here's the failing PR jobTo give a little bit of a background, I maintain Lerna-Lite (a fork of Lerna but rewritten as ESM) and the latest version of
conventional-changelog-angular
(which is a breaking version), that came out a few weeks ago, migrated from the Q library to pure Promise (see their v6 changelog).The code and library works fine in real world usage (I previewed a release in Lerna-Lite and it works fine and I added console logs to make sure of it), so it only fails in Vitest but not outside of it.
Reproduction
Here's a Stackblitz repro: https://stackblitz.com/edit/vitest-dev-vitest-conventional?file=test%2Fbasic.test.ts
Calling this simple test
will throw
or in some cases it throws this other but similar error
System Info
Used Package Manager
pnpm
Validations