Skip to content

<object> tag does not import SVGs #7062

@wwwonka

Description

@wwwonka

Describe the bug

When I import an SVG using the img tag, vite.js copies a hashed version in the build folder without issue.

It does not work when using the object tag though. Any ways to resolve this issue?

Reproduction

https://stackblitz.com/edit/vitejs-vite-nnsdp9?file=index.html

System Info

System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
    Memory: 129.19 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 17.0.1 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.5.1 - /usr/local/bin/npm
  Browsers:
    Brave Browser: 98.1.35.104
    Chrome: 98.0.4758.102
    Chrome Canary: 101.0.4899.0
    Edge: 93.0.961.47
    Firefox: 97.0.1
    Safari: 14.1.2
  npmPackages:
    vite: ^2.8.0 => 2.8.4

Used Package Manager

npm

Logs

No response

Validations

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