Skip to content

hasAttribute is not a function #15241

Closed
@KTibow

Description

@KTibow

Describe the bug

some specific code specifically in sveltekit specifically when built causes a runtime error, likely due to there being no value assigned

this may seem like a silly case but it makes sense when only demonstrating UI components

if this behavior shouldn't be allowed, then svelte should error at compile time

Reproduction

https://github.com/KTibow/hasattributebug

Logs

2.C2l9EObT.js:36 Uncaught (in promise) TypeError: input.hasAttribute is not a function
    at Array.remove_defaults (2.C2l9EObT.js:36:15)
    at run_all (BjTd4EYN.js:18:11)
    at process_idle_tasks (BjTd4EYN.js:787:3)
    at flush_tasks (BjTd4EYN.js:808:5)
    at flush_sync (BjTd4EYN.js:1265:5)
    at new Svelte4Component (app.LvR6wlp0.js:446:7)
    at new <anonymous> (app.LvR6wlp0.js:395:7)
    at initialize (DSRet70y.js:1061:10)
    at _hydrate (DSRet70y.js:2210:3)
    at async Module.start (DSRet70y.js:973:5)

System Info

System:
    OS: Linux 6.12 Fedora Linux 41 (Workstation Edition)
    CPU: (8) x64 Intel(R) Core(TM) i5-1035G4 CPU @ 1.10GHz
    Memory: 7.24 GB / 15.21 GB
    Container: Yes
    Shell: 3.7.0 - /usr/bin/fish
  Binaries:
    Node: 22.12.0 - ~/.local/share/pnpm/node
    npm: 10.9.0 - ~/.local/share/pnpm/npm
    pnpm: 10.2.0 - ~/.local/share/pnpm/pnpm
  npmPackages:
    svelte: ^5.0.0 => 5.19.9

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions