TIL: Vitest + RTK - Cannot read properties of undefined (reading 'reducerPath')

I faced this error while trying to run a component test using vitest.

Import order was the issue here. Ultimately, the fix was something like this:

Changing from

import Component from '@src/Component'
import { renderWithProviders } from '@src/util'

To this

import { renderWithProviders } from '@src/util'
import Component from '@src/component'

More context