Closed bitabs closed 1 year ago
Hey @bitabs, thanks for raising this. We'll get investigating! I suspect it's something to do with how the module is packaged...
Are you just using a blitzjs starter? Is there a minimal repro you can share? I'm not overly familiar with blitz :D
Hya 👋🏻 @dglsparsons - Yes, It's a Blitz starter indeed. Can you please try the starter?
Hey @bitabs! Sorry, but I'm struggling to reproduce this - I'm being frustratingly blocked on this Blitz issue which means I'm struggling to get any tests to work at all in Blitz.
I was, however, able to set up a brand new NextJS project based on the NextJS Jest Example. Adding Analytics to this in either the _app.tsx file, or in a specific page gave me no issues at all though - and worked exactly as you'd expect.
It seems like the issue is with the Blitz jest config because of this. However, since I'm unable to reproduce I can't confirm this.
Sorry to ask again, but I don't suppose you are able to share any reproduction?
Hey just here to add some context. We had some issues with jest & some types. There is a PR open currently to scrap jest completely and move to vitest https://github.com/blitz-js/blitz/pull/3985
@dglsparsons I share your frustration, unfortunately. 😞 It looks like something very specific to Blitz. @dillonraphael Thanks for jumping in and adding some context 🙇.
I guess I'll close this ticket for the time being 🙏🏻
For me it was a matter of adding this to "jest"
config in package.json
:
"jest": {
"moduleNameMapper": {
"@vercel/analytics/react": "identity-obj-proxy"
}
},
Hi there,
I'm using Blitz, and Jest test is failing:
Jest