Skip to content

Class constructor Element cannot be invoked without 'new' #55

Open
@edemaine

Description

@edemaine

I'm getting the following error when trying to build a basic filter

svg.filter.js:16 Uncaught TypeError: Class constructor Element cannot be invoked without 'new'
    at new Filter (svg.filter.js:16)
    at Defs.filter (svg.filter.js:316)
    at Use.filterWith (svg.filter.js:336)

I don't understand why this error occurs, because svg.filter.js:316 clearly has a new:

var filter = this.put(new Filter())

My code:

robot.filterWith((add) =>
  add.colorMatrix('hueRotate', 0))

(robot is an SVG.Use object.)

package.json dependencies:

  "dependencies": {
    "@svgdotjs/svg.filter.js": "^3.0.7",
    "@svgdotjs/svg.js": "^3.0.16"
  }

HTML:

<script src="node_modules/@svgdotjs/svg.js/dist/svg.min.js"></script>
<script src="node_modules/@svgdotjs/svg.filter.js/dist/svg.filter.js"></script>

Am I missing something obvious?

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