Skip to content

Vue compiler emits DUPLICATE_ATTRIBUTE error instead of ignoring duplicates #4883

@Archangel603

Description

@Archangel603

Version

3.2.20

Reproduction link

codesandbox.io

Steps to reproduce

run node src/index.js in terminal

What is expected?

According to HTML5 spec
https://html.spec.whatwg.org/multipage/parsing.html#parse-error-duplicate-attribute
parser should ignore all duplicates

What is actually happening?

Parser throws SyntaxError("Duplicate attribute.")


This problem doesn't affect work in browser or SSR with @vue/server-renderer, only prints warning. However, in vite-plugin-ssr this error causes render to fail. I understand that duplicated attributes is something abnormal but in some cases (vuejs/vue#10837) they can occur.

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