sveltejs / kit

web development, streamlined
https://kit.svelte.dev
MIT License
17.81k stars 1.78k forks source link

Email validator on $page.form is outdated or just wrong #12136

Open kratos-digital opened 4 weeks ago

kratos-digital commented 4 weeks ago

Describe the bug

Email validator returns incorrect email error on valid emails. This is valid email address: hello@kratos.digital and your system marks it as incorrect.

{"email":"hello@kratos.digital","incorrect":true}

Reproduction

Simple HTML form with email input type

Logs

No response

System Info

System:
    OS: macOS 14.4.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 2.80 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.7.3 - ~/.nvm/versions/node/v21.7.3/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v21.7.3/bin/npm
    pnpm: 8.9.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 123.0.6312.124
    Safari: 17.4.1
  npmPackages:
    @sveltejs/adapter-auto: ^3.0.0 => 3.1.1 
    @sveltejs/adapter-node: ^3.0.1 => 3.0.3 
    @sveltejs/adapter-static: ^3.0.1 => 3.0.1 
    @sveltejs/kit: ^2.0.0 => 2.5.0 
    @sveltejs/vite-plugin-svelte: ^3.0.0 => 3.0.2 
    svelte: ^4.2.7 => 4.2.11 
    vite: ^5.0.3 => 5.1.3

Severity

annoyance

Additional Information

No response

dummdidumm commented 4 weeks ago

There's no built-in email validator whatsoever in SvelteKit. Please provide an minimum reproduction.

kratos-digital commented 4 weeks ago

import { page } from '$app/stores';

And then using $page.form...

So you're saying that $app/stores is not part of SvelteKit?

dummdidumm commented 4 weeks ago

This is not a minimum reproduction. A minimum reproduction is for example a link to stackblitz showcasing the problem.

$app/stores does belong to SvelteKit, but there's nothing built into SvelteKit that validates emails. I'm very certain that this is not related to SvelteKit but to your code not validating the email correctly.