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
- The contents of
renderWithProviders
can be found in RTK documentation here.