hey I m using vitest for testing and
hey! I'm using vitest for testing, and "suddenly" (in quotes as I can't figure out how I broke it) I get the following error:
9 Replies
Hey! 👋 Were you able to get tests running successfully with
vitest-environment-miniflare
before? Have you upgraded any packages recently?hey! yeah, I use vitest for some months on this project, running tests multiple times daily, and for some reason I can't understand what changed .. I was just writing a new module and this triggered when I started testing it .. super strange, and ofc I know that I caused it .. but I even rollbacked to some versions back from my repo, and still get the same error (always
rm -rf node_modules
and npm i
before testing it) .. I have no idea what I broke and how 😄
i also tried removing the miniflare environment from vitest and tried to initiate the tests using the mf api, but it wasn't so much successful
also tried to use the ultimate console.log()
in nodemodules to understand where exactly it breaks, and got inside getGlobalScope()
in the shared-test-environment
package, where it was failing before await this.#initPromise;
¯_(ツ)/¯Hmmmm 🙃 when you did
rm -rf node_modules
, did you also rm package-lock.json
?negative 🙂
I'll give it a shot again, I'll let you know if anything change 🙂
nah, same error (without the trace though as I was using an older vitest version at the point of this branch) ..
miniflare 2.10.0
+ vitest-environment-miniflare 2.10.0
+ vitest 0.24.0
I cannot pinpoint it to a changed version of these three packages .. this is the problem..Which
node
version are you using?v19.1.0
I will now try to re-create the project from scratch on a clean directory and check what's happeningHmmm, could you try on
16
? Haven't tested Miniflare 2 on Node 19 yet. I'd recommend https://volta.sh/ if you're not already using a Node version manager.Volta - The Hassle-Free JavaScript Tool Manager
Volta: Start your engines.
sure, i'll give it a shot and report back, thanks!
ok, 3 things!
1) volta rocks 😄
2)
and 3) I have no idea what happened 😄
I really didn't mess with the node version at least today
but anyways, thanks a lot once again for all your work 😄
No problem! 🙂 Glad it's all working again.