You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, we have tried to update our BE app to start using Fastify v5, we had to update to [email protected], but now when we want to run our tests -we use jest- we are getting the following error:
TypeError: A dynamic import callback was invoked without --experimental-vm-modules
at buildCache (../node_modules/mercurius/index.js:65:20)
at Object.<anonymous>.fp.name (../node_modules/mercurius/index.js:71:21)
at Plugin.Object.<anonymous>.Plugin.exec (../node_modules/avvio/lib/plugin.js:125:28)
at Boot.Object.<anonymous>.Boot._loadPlugin (../node_modules/avvio/boot.js:432:10)
Seems buildCache does something like const QuickLRU = (await import('quick-lru')).default we know Nodejs supports this, but seems that Jest doesn't like it.
is there any way to deal with this ?
The text was updated successfully, but these errors were encountered:
Yikes, Jest doesn’t support dynamic import of ESM modules?!
One can surely find or make an LRU implementation that behaves like a Map and isn’t an ESM module, but even if one does there is no guarantee that no other dependency of Mercurius suddenly starts using dynamic imports of ESM in their CJS – because that is perfectly fine and not a breaking change to do.
I would say that Jest is the one in the wrong here.
Hey, we have tried to update our BE app to start using Fastify v5, we had to update to [email protected], but now when we want to run our tests -we use jest- we are getting the following error:
Seems buildCache does something like
const QuickLRU = (await import('quick-lru')).default
we know Nodejs supports this, but seems that Jest doesn't like it.is there any way to deal with this ?
The text was updated successfully, but these errors were encountered: