Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🩹 [open-formulieren/open-forms#4929] Workaround react-router/dom issue
In vitest the react-router and react-router/dom imports resolve to (CommonJS?) bundles which each contain copies of the contexts/objects used by react router, which make you effectively end up with multiple installations of react router. This leads to broken contexts and failing tests, see remix-run/react-router#12785 for more context. Patching the resolution in vite config allows us to force loading the mjs modules instead of the CJS build which doesn't have this problem, because both the react-router and react-router/dom entrypoints depend on the same chunk containing the shared code.
- Loading branch information