Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with directive selector inside SVG when using IVY #32061

Closed
mitch8 opened this issue Aug 9, 2019 · 2 comments

Comments

@mitch8
Copy link

@mitch8 mitch8 commented Aug 9, 2019

馃悶 bug report

Affected Package

IVY Compiler

Is this a regression?

Yes, works fine without IVY

Description

A directive or component with a selector of type 'element[attribute]' and Inputs will not compile under IVY if used inside an SVG template.

An attribute selector works as expected.

馃敩 Minimal Reproduction

https://github.com/mitch8/ivy-issue

The issue is only present when building with IVY.


"angularCompilerOptions": {
    "enableIvy": true,
  }

ng build works fine
ng build --prod fail with IVY enabled

馃敟 Exception or Error

If the directive is part of my app I get an error like this.


ERROR in src/app/app.component.html(4,9): Property 'test' does not exist on type 'HTMLElement'.

Interestingly, if the directive is part of a library from node_modules, it will compile without errors under IVY, however you will then get a runtime error.


Can't bind to 'test' since it isn't a known property of 'text'

馃實 Your Environment

Angular Version:
Angular CLI: 8.2.1
Node: 10.13.0
OS: win32 x64
Angular: 8.2.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package Version

@angular-devkit/architect 0.802.1
@angular-devkit/build-angular 0.802.1
@angular-devkit/build-optimizer 0.802.1
@angular-devkit/build-webpack 0.802.1
@angular-devkit/core 8.2.1
@angular-devkit/schematics 8.2.1
@ngtools/webpack 8.2.1
@schematics/angular 8.2.1
@schematics/update 0.802.1
rxjs 6.4.0
typescript 3.5.3
webpack 4.38.0

@ngbot ngbot bot added this to the needsTriage milestone Aug 9, 2019
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Aug 13, 2019
@alxhub alxhub added this to Backlog in Compiler via automation Aug 13, 2019
@llimos

This comment has been minimized.

Copy link

@llimos llimos commented Aug 19, 2019

This seems to be affecting the popular @swimlane/ngx-charts library, which is using such directives on SVG's and is not working for me at all under Ivy

@cal-smith

This comment has been minimized.

Copy link

@cal-smith cal-smith commented Sep 27, 2019

I seem to be hitting this with our Angular icon package (we also use directives on SVGs, it's pretty core to the functionality of our library). This is the error the compiler gives me:
image

Which is produced by this code:

<svg ibmIconAddAlt [size]="'16'"></svg>

I can provide a minimal environment if needed 馃憤

JoostK added a commit to JoostK/angular that referenced this issue Nov 3, 2019
Prior to this change, namespaced elements such as SVG elements would not
participate correctly in directive matching as their namespace was not
ignored, which was the case with the View Engine compiler. This led to
incorrect behavior at runtime and template type checking.

This commit resolved the issue by ignoring the namespace of elements and
attributes like they were in View Engine.

Fixes angular#32061
@JoostK JoostK added the state: has PR label Nov 3, 2019
@atscott atscott closed this in bca4376 Nov 7, 2019
atscott added a commit that referenced this issue Nov 7, 2019
Prior to this change, namespaced elements such as SVG elements would not
participate correctly in directive matching as their namespace was not
ignored, which was the case with the View Engine compiler. This led to
incorrect behavior at runtime and template type checking.

This commit resolved the issue by ignoring the namespace of elements and
attributes like they were in View Engine.

Fixes #32061

PR Close #33555
mohaxspb added a commit to mohaxspb/angular that referenced this issue Nov 7, 2019
Prior to this change, namespaced elements such as SVG elements would not
participate correctly in directive matching as their namespace was not
ignored, which was the case with the View Engine compiler. This led to
incorrect behavior at runtime and template type checking.

This commit resolved the issue by ignoring the namespace of elements and
attributes like they were in View Engine.

Fixes angular#32061

PR Close angular#33555
mohaxspb added a commit to mohaxspb/angular that referenced this issue Nov 7, 2019
Prior to this change, namespaced elements such as SVG elements would not
participate correctly in directive matching as their namespace was not
ignored, which was the case with the View Engine compiler. This led to
incorrect behavior at runtime and template type checking.

This commit resolved the issue by ignoring the namespace of elements and
attributes like they were in View Engine.

Fixes angular#32061

PR Close angular#33555
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Compiler
Backlog
6 participants
You can鈥檛 perform that action at this time.