Closed kyeckeq closed 7 months ago
It sounds like your dependencies vs. your coworker's dependencies are different, and this might be the cause of your problem.
Out of interest, does the CLI work for you if you try and run your tests outside of Wallaby? I would have expected you would have the same problem, but it's possible it's specific to Wallaby.
Can you please try cloning your repo to a fresh directory, reinstalling your node modules, and then restarting Wallaby?
If that doesn't work for you, can you please try the same thing on your coworker's machine to see if it then breaks in the same way?
Finally, that that doesn't work, can you do a file diff for your project / dependencies vs. your coworker? This should allow you to understand why you're getting different test results.
Hi and thank you for the quick reply. After going through your recommendations, here's the results...
After a bit of digging on the internet, I found this issue with swc
, which is where your stack trace is originating.
I would have expected to see the same error from the jest CLI. I'm guessing there may be some environment variable set when jest is running that is not set when Wallaby is running that changes in the behavior/options passed to swc
. You may be able to try debugging this by modifying node_modules/next/dist/build/swc/index.js
and adding some logging (e.g. console.log) before transformSync
calls to see how the options
parameter differs when you run with jest
vs. wallaby
. This may reveal what you're missing when Wallaby is running.
It seems that this problem was fixed in swc@1.3.106
, so perhaps updating your dependencies will also fix the problem?
I tried debugging and determined it comes down to the config parameter that's passed to jest-runner in runTest() (runTest.js). I was able to resolve the issue by setting modularizeImports = undefined (in config.transform). Unfortunately, I wasn't able to figure out where/how that property is being set differently from my coworker, but at least I've got a work-around now that allows Wallaby to startup without any errors.
re: swc -- We're running next v13.4.4. Bumping to v13.5 will allow us to move to optimizePackageImports which may resolve the issue but we're not able to do that at the moment.
If you have any other valuable insight, please feel free to pass along. For now, I'm comfortable closing this request/issue.
Thank you for all of your help!
Glad to hear that you got it working. We don't have any other suggestions at this point in time, but happy to revisit with you later if needed.
Issue description or question
Need assistance getting Wallaby running in a VS Code project (Next.js/Jest). Wallaby was running fine, but recently stopped with an "invalid type: map" error and I have been unable to get it working again. All of the code/configuration is under source control and my coworker does not have this issue. We compared diagnostics reports and there are a couple differences (eg. his "modularizeImports" setting is undefined and "hasServerComponents" is true). I cannot find where the differeneces are getting picked up from or how to change them (to see if that would resolve the error). I've tried clearing the cache (Jest and Wallaby), reinstalling Wallaby, etc. to no avail. Any assistance would be appreciated!
Wallaby diagnostics report