Skip to content

1.0.7: fix errors stored under key, restore the license, document setErrors - #1

Merged
pmochine merged 8 commits into
masterfrom
modernisierung-2026-10
Oct 7, 2026
Merged

pmochine merged 8 commits into
masterfrom
modernisierung-2026-10

Conversation

@pmochine

@pmochine pmochine commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Summary

1.0.7 is the last release of the 1.x line (Vue 2, vee-validate 2).

  • Fix: since 1.0.4, $addLaravelErrors stored each error under key instead of field. vee-validate 2 finds errors by field, so errors.has('name') was false, errors.first('name') was undefined, and templates showed no message. It is now field: key.
  • License: the first commit of this fork (2019) deleted the MIT license of the original package, and no published tarball contains it. This restores LICENSE with the original copyright line and a line for the fork. The package ships it again.
  • README: vee-validate 3 and 4 do not need this package, because setErrors(error.response.data.errors) reads the Laravel format. The README shows tested examples for vee-validate 4 and 3, lists the known issues of 1.x, and shows lines that replace the package for vee-validate 2.
  • Tooling: ESLint 9 with eslint-config-avidofood 4, Vitest tests, CI on GitHub Actions (Node 22 and 24), "files": ["src"]. .eslintrc.js leaves the package.

Checks

  • npm ci, npm run lint, npm test: 6 tests pass. 4 of them fail without the fix.
  • npm pack: 4 files (LICENSE, README.md, package.json, src/vee-validate-laravel.js), identical to the repository.
  • Import test with the tarball in an empty folder: vee-validate 2.1.1 and 2.2.15 with Vue 2.7.16, plus a Vite 8 build.
  • Every README example ran word for word in tests (vee-validate 4.15.1, 3.4.15 and 2.2.15).
  • Independent review by Codex (gpt-6-astra): three rounds, final verdict green.

After the merge

  1. Publish 1.0.7 by hand, before 2.0.0. Otherwise npm sets latest to 1.0.7.
  2. Create the branch 1x from this state and tag 1.0.7 there.
  3. Version 2.0.0 for Vue 3 follows in a separate pull request.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JEDv3tsdEL7sjLdisXuVHA

pmochine and others added 8 commits October 7, 2026 15:15
The first commit of this fork deleted LICENSE. The MIT license requires
the copyright notice in all copies, and package.json declares MIT.
This restores the original text and adds a line for the fork.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEDv3tsdEL7sjLdisXuVHA
vee-validate 3 and 4 read the Laravel error format with setErrors, so
these versions do not need this package. The README shows the tested
examples, the status of the 1.x line, and the known issue in 1.0.4 to
1.0.6: errors are stored under "key" instead of "field", so
errors.has() and errors.first() do not find them. It also shows lines
that replace the package for vee-validate 2.

The license badge now points to LICENSE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEDv3tsdEL7sjLdisXuVHA
- Nested fields: <ErrorMessage> only finds the bracket form, so the
  README now uses users[0].email for <Field>, useField and
  <ErrorMessage>, and passes the Laravel keys to setErrors as they are.
- Name which APIs show all messages (useField().errors, errorBag) and
  which show only the first one.
- Say when a field validates again: <Field> on change and blur, not on
  input. useField on each value change.
- An error for a key without a field only stays without a
  validationSchema, and it keeps meta.valid false.
- vee-validate 3: keys must match the vid exactly, with an example.
- Known issues of 1.x: 1.0.3 adds no errors, the error bag is cleared
  for every response with data, and messages must be lists.
- Laravel sends the 422 JSON body only for requests that expect JSON.
- The status section says that the package is no longer developed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEDv3tsdEL7sjLdisXuVHA
eslint-config-avidofood 4 needs ESLint 9 and its flat config, so
.eslintrc.js goes away. The old config turned off no-unused-vars and
no-param-reassign for the whole project. Instead, the unused options
parameter of install() is removed, and no-param-reassign only allows
the plugin to add its method to Vue.prototype.

The new lockfile drops the 24 audit findings of the ESLint 6 chain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEDv3tsdEL7sjLdisXuVHA
Since 1.0.4, $addLaravelErrors added each error as { key, msg }.
vee-validate 2 finds errors by their field, so errors.has('name') was
false and errors.first('name') was undefined, and templates showed no
message. Commit b45c3fb renamed the loop variable from field to key
but kept "field" in the error object. In 1.0.3 this caused a
ReferenceError, which the try/catch caught, so no error was added.
Commit 4630485 then changed "field" to "key" in the error object. It
must be "field: key".

Tests with Vitest, jsdom, Vue 2.7 and vee-validate 2.2.15 cover the
fix and the other behavior: joined messages, the return value, the
reset of old errors and the null cases. Four of the six tests fail
without the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEDv3tsdEL7sjLdisXuVHA
GitHub Actions runs lint, the tests and npm pack --dry-run on Node 22
and 24 for each push to master and each pull request. Vitest 5 and
jsdom 29 need Node.js ^22.13, 24, or 26 and newer. .nvmrc selects
Node 24 for local work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEDv3tsdEL7sjLdisXuVHA
1.0.7 is the last version. It ships the fix for errors under "key",
the MIT license and the new README. "files" limits the package to
src/, so .eslintrc.js and the new development files stay out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEDv3tsdEL7sjLdisXuVHA
- CHANGELOG: the development tools need Node.js ^22.13, 24 or 26 and
  newer. jsdom 29 rejects 22.12, and Vitest 5 rejects 23 and 25.
- README: the changelog link points to GitHub, because the package
  does not contain CHANGELOG.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEDv3tsdEL7sjLdisXuVHA
@pmochine
pmochine merged commit f2980da into master Oct 7, 2026
2 checks passed
pmochine added a commit that referenced this pull request Oct 8, 2026
master has the merge commit of pull request #1. Its tree equals
1.0.7 (a4e193f), which this branch already contains, so no file
changes. After this merge, pull request #2 only shows 2.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEDv3tsdEL7sjLdisXuVHA
@pmochine
pmochine deleted the modernisierung-2026-10 branch October 8, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant