Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek/deepseek-v4-pro· deepseekHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION defineModel on Firefox does not work as expected Vue version 3.5.17…

  1. User

    ISSUE DESCRIPTION

    defineModel on Firefox does not work as expected

    Vue version

    3.5.17

    Link to minimal reproduction

    https://play.vuejs.org/#eNqFUslOwzAQ/RXLlxSppAc4lRaxqIcisQgQJ1+idBJcnLHlJVSq8u+MnbYUynKy573xm+eZWfNLY/I2AB/ziSutNJ458MEwVWA9Fdw7wc8FysZo69maWag6VlndsIxeZTvmWjdmg+ejGETR7EygwFKj86xodEDPplFhkGVHAiejviDJU+ChMarwQBFjkyTXHjd6AYpc9I8FHxE7Ge2l8iE5pAKVrPOl00jfWEcBwUtSkArsvfGSDAg+ZomJXKGUfr9JmLcBhlu8fIXy7Qd86VYRE/zBggPbguA7zhe2BrIW6dnTHazoviPJf1CU/Qf5CE6rED32aVcBF2R7Ly+5nac2S6yf3WzlAd32U9FozOxSvuDU9ti8377+afckP03vBHbUxe3I/tmDfpZpLDTKBVQS4TZGAxqowCpgGWsyjXM0wQ+gBfRjNovHUe9CQRKQlYTFS6ECkFBW0CaxXjdvN+CXJHL5bWMOdkbGintLk07B2UUiCNiYIuhwj7oPe2AHrg

    Steps to reproduce

    1. Use firefox
    2. Enter anything in the field. It should be blocked and only show "a", but it wont on firefox.

    What is expected?

    It should only keep "a" and nothing else should "make it through"

    What is actually happening?

    Seems like either a race condition or firefox not updating at the same time as Chrome? no clue.

    System Info

    System:
        OS: Windows 11 10.0.26100
        CPU: (20) x64 Intel(R) Core(TM) i5-14600K
        Memory: 12.60 GB / 31.77 GB
      Binaries:
        Node: 22.16.0 - C:\nvm4w\nodejs\node.EXE
        npm: 10.9.2 - C:\nvm4w\nodejs\npm.CMD
      Browsers:
        Edge: Chromium (134.0.3124.85)
        Internet Explorer: 11.0.26100.1882
    
    -- Its not showing my actual browser: Firefox 139.0.4
    

    Any additional comments?

    No response

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /core, current file: none) bash-$

  2. DeepSeek Assistant

    Let me start by understanding the issue. It's about defineModel on Firefox not working as expected. There's a reproduction link to the Vue playground, which I can't access directly. Let me explore the repository structure to understand the codebase and then find the relevant code related to defineModel.

    Let me first explore the repository structure.

  3. DeepSeek Assistant

    This is the Vue core repository. Let me explore the packages directory to understand the structure.

  4. DeepSeek Assistant

    Now let me look at the compiler-sfc package where defineModel is likely implemented, and also search for defineModel across the codebase

  5. DeepSeek Assistant

    Let me look at the key files related to defineModel:

  6. DeepSeek Assistant

    The open command doesn't seem to work. Let me try with a different approach.

  7. DeepSeek Assistant

    Let me look at the compiler-sfc side of `defineModel

  8. DeepSeek Assistant

    The runtime implementation is useModel. Let me find that.

  9. DeepSeek Assistant

    Let me look at the useModel runtime implementation

  10. DeepSeek Assistant

    Let me look at recent changes to the useModel implementation and any related Firefox fixes

  11. DeepSeek Assistant

    Let me search for related commits and issues

  12. DeepSeek Assistant

    Let me decode the playground URL to understand the exact reproduction code

  13. DeepSeek Assistant

    Let me look at the hasChanged utility function

  14. DeepSeek Assistant

    Let me see the hasChanged function.

  15. DeepSeek Assistant

    Let me look at the useModel tests to understand the expected behavior better

  16. DeepSeek Assistant

    Let me check the watchSyncEffect implementation

  17. DeepSeek Assistant

    Let me look at the watchSyncEffect

  18. DeepSeek Assistant

    Let me look at the doWatch function, focusing on the sync flush

  19. DeepSeek Assistant

    Let me look at the doWatch function

  20. DeepSeek Assistant

    Let me look at the v-model runtime-dom implementation

  21. DeepSeek Assistant

    Let me look at vModel.ts.

  22. DeepSeek Assistant

    Let me try to decode the playground URL properly

  23. DeepSeek Assistant

    Let me install lz-string and decode the playground

  24. DeepSeek Assistant

    Now let me decode it.

  25. DeepSeek Assistant

    Let me try the other LZString method

  26. DeepSeek Assistant

    Now I have a good understanding of the issue. Let me create a reproduction test first to confirm the bug

  27. DeepSeek Assistant

    Let me now implement the fix in useModel.ts

  28. DeepSeek Assistant

    Let me go back to the repo root

  29. DeepSeek Assistant

    Now I understand the issue. Let me implement the fix. There are two problems in the useModel setter:

    1. Early return on first call: When prevSetValue is EMPTY_OBJ (first call) and the setter transforms the value to the same as localValue, the early return incorrectly fires because prevSetValue !== EMPTY_OBJ is false.

    2. Force-update condition: Even if we fix #1, the force-update check !hasChanged(emittedValue, prevEmittedValue) fails on the first call because prevEmittedValue is undefined.

    Let me apply the fix:

  30. DeepSeek Assistant

    Let me use the replace command with proper

  31. DeepSeek Assistant

    Now fix the force-update condition to handle the first call (where prevEmittedValue is undefined):

  32. DeepSeek Assistant

    Let me verify the full setter function looks correct

  33. DeepSeek Assistant

    Now let me run the existing tests for useModel to make sure nothing is broken

  34. DeepSeek Assistant

    All 14 tests pass. Let me also run the defineModel tests from compiler-sfc

  35. DeepSeek Assistant

    Both test suites pass. Now let me write a quick reproduction script to verify the fix works for the specific Firefox issue

  36. DeepSeek Assistant

    Let me also run the broader runtime-core tests related to components and v-model

  37. DeepSeek Assistant

    Let me also run any vModel-related tests

  38. DeepSeek Assistant

    Let me also run the full compileScript tests

  39. DeepSeek Assistant

    All tests pass. Let me now review the final state of the file

  40. DeepSeek Assistant

    The fix looks correct. Let me verify the edge cases one more time by analyzing the logic:

    Fix 1: Added !hasChanged(value, emittedValue) to the early return condition.

    • This prevents early return when the setter transforms the input value to a different emitted value, even on the first call (when prevSetValue is EMPTY_OBJ).

    Fix 2: Changed !hasChanged(emittedValue, prevEmittedValue) to use localValue as fallback when prevEmittedValue is undefined.

    • On the first call, prevEmittedValue is undefined, so we compare against localValue instead. This ensures the force-update triggers when the emitted value equals the current local value (meaning parent won't detect a change, but the input is out of sync).

    Let me run the full test suite one more time to be sure:

  41. DeepSeek Assistant

    All 26 tests pass. Let me verify the change one final

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.