Skip to content

Loading an image source within SVG <image> xlink:href fails #569

Closed
@TheLarkInn

Description

@TheLarkInn

(Hi all working on vue-loader, we came across this issue in our core repo from @sdras, moving it here:)

First off, thanks so much for your hard work on webpack, I use it every day! 🙌

After speaking to @TheLarkInn, I do believe that this is a bug, though likely low use-case. (until people figure out how awesome this implementation is 😎)

Currently if I load an image with a relative src within a .vue file, it works, but images embedded within an SVG DOM are not recognized. This is probably due to the XML markup for image, where you would create an tag and then within it use an xlink:href="" attribute instead of src="" to load the relative path. When I use an absolute path, I observe the correct behavior, and the image loads.

Benefits of using the SVG to load an image include but are not limited to:

image positioning: for dynamic content, an SVG image can be placed exactly without absolute positioning because you're using the SVG coordinate system
responsive, as this positioning will be stable along with other images within the same coordinate system
I'm on a MacBook Pro, node version v6.7.0.

Thank you very much for your attention in the matter!

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