Everything works when I run my app using npm run. However, when I do npm run build and serve the app locally or deploy to Azure, I get these errors when I try to navigate to any page:
I have "homepage": ".", in my package.json. I'm using react-router v6. Not sure what else could be related.
Further debugging shows me that React.lazy seems to be the cause:
const ProfilesPage = React.lazy(() => import('./views/profiles'));
Directly using <ProfilesPage /> instead of the lazy import fixes the problem.
