msw
: No known conditions for "./browser" specifier in "msw" package..
#809
Unanswered
bogdan0083
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey guys! Did anyone try to setup msw to mock api? I'm setting it up inside
plugins
:*In
dev
enviroment (npm run dev
) it works just fine. I'm receiving mocked data without a problem on the server and on the client (when navigating between the routes)But it doesn't work for
e2e
tests. Here an example:This test throws the error
[nuxt] error caught during app initialization Error: No known conditions for "./browser" specifier in "msw" package..
. For some reason when nuxt server is set up it executes the client clause:if (import.meta.client)
, but the clauseimport.meta.server
is not detected.How can I make nuxt server in test mode take
import.meta.client
andimport.meta.server
into consideration?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions