Skip to content

Vue fails to mount in environments that don't provide window.SVGElement #3590

Open
@xinix

Description

@xinix

Version

3.0.11

Reproduction link

https://github.com/xinix/vue3-svg-bug

Steps to reproduce

Create a sample Vue3 app with Vue UI:

vue create demo

Select the following:

  • Manually select features
  • Choose Vue 3.x (preview)
  • Class-style syntax? No
  • Unit testing solution: Mocha
npm install 
npm run test:unit

What is expected?

Sample test to run

What is actually happening?

An error is thrown:

ReferenceError: SVGElement is not defined
    at Object.app.mount (dist/js/webpack:/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js:1259:1)
    at mount (dist/js/webpack:/node_modules/@vue/test-utils/dist/vue-test-utils.esm-bundler.js:2310:1)
    at shallowMount (dist/js/webpack:/node_modules/@vue/test-utils/dist/vue-test-utils.esm-bundler.js:2329:1)
    at Context.<anonymous> (dist/js/webpack:/tests/unit/example.spec.ts:8:1)
    at processImmediate (internal/timers.js:461:21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    🍰 p2-nice-to-havePriority 2: this is not breaking anything but nice to have it addressed.✨ feature requestNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions