Skip to content

Trying to build Web Components for SVG should produce a warning/error #5833

Open
@akauppi

Description

@akauppi

Web Components are HTML only and not supported in the SVG namespace.

However, users such as me might not know this, and it would be helpful if the Svelte compiler told us so.

Describe the bug
Currently (Dec 2020), Svelte compiles a source with <svelte:options namespace="svg" tag="svsv-draggable" /> quietly.

The output contains:

SvelteElement = class extends HTMLElement {

This is enough to convince me that the code tries to make an HTML Web Component, but I haven't fully traced the output.

Expected behavior
Give the user a nice message, saying what we're trying to reach is not currently possible.

Information about your Svelte project:

  • Svelte version: 3.31.0
  • Whether your project uses Webpack or Rollup: Rollup

Severity
Not severe. Helpful.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions