I've been trying to resolve this test error for a while now with not success. Recently I upgraded React Native from 0.72.3 to 0.74.3 and got the Android application to build and run, however, I can't get all the tests to pass. I am currently getting the following error:
TypeError: A dynamic import callback was invoked without --experimental-vm-modules
Inside my icons.ts file which dynamically lazy loads icons the following way:
const Icons = {
sun: lazy(() => import('@src/assets/icons/sun.svg')),
moon: lazy(() => import('@src/assets/icons/moon.svg')),
cloud: lazy(() => import('@src/assets/icons/cloud.svg')),
}
The tests were passing fine before, and now they no longer pass. I believe adding --experimental-vm-modules solves that specific error, but causes other errors and from what I've read, using that flag is not advised. Is there anything else I can do to resolve this issue?