Error AtlasError Documentation and Resolution

Vite failed because code requires non-strict mode

[ERROR] With statements cannot be used with the "esm" output format due to strict mode

Vite encountered code that only works in sloppy mode, but Vite uses ESM and strict mode, so the code cannot be transformed safely.

With statements cannot be used with the "esm" output format due to strict modebuild errors
[ERROR] With statements cannot be used with the "esm" output format due to strict mode
  • Application or dependency code relies on non-strict JavaScript behavior.
  • A dependency uses `with` statements or similar patterns that are incompatible with ESM strict mode.
  • Legacy code is being bundled through Vite without modernization.
  1. Remove or rewrite non-strict mode patterns in your own code.
  2. Patch or replace dependencies that rely on sloppy-mode-only behavior.
  3. Keep legacy code out of the Vite client pipeline if it cannot be modernized.
Vite: Troubleshooting
Vite with statements cannot be used with the esm output format: causes and fixes | Error Atlas