aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
15.89k stars 558 forks source link

Form validation is not working properly after adding million.vite({ auto: true }) #989

Closed alexeychikk closed 3 months ago

alexeychikk commented 3 months ago

What version of million are you using?

3.0.6

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Windows

What browser are you using?

Chrome

Describe the Bug

I am using react-hook-form and @hookform/resolvers/class-validator together with mobx. After I added million.vite({ auto: true }) to my vite.config.ts validation just stopped working properly, errors are shown for the correct input. It can be reproduced in my monorepo: https://github.com/alexeychikk/tft-roller (npm i) You'll just need to switch tft-roller-client branch to: https://github.com/alexeychikk/tft-roller-client/tree/million-bug (npm start) Just try to enter an alphanumeric nickname and observe validation errors. Then try to remove million.vite({ auto: true }) - and now it works again.

ps. sorry for being too lazy to create a proper MRE, but maybe someone already solved this

What's the expected result?

Validation should work properly after adding million.vite({ auto: true }) to vite.config.ts.

Link to Minimal Reproducible Example

https://github.com/alexeychikk/tft-roller-client/tree/million-bug

Participation

github-actions[bot] commented 3 months ago

Thanks for opening this issue! A maintainer will review it soon.

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days.