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

Ivy: Using HTML tags inside SVG tags throws error with IVY: ':xhtml:div' is not a known element #34171

Closed
marjan-georgiev opened this issue Dec 2, 2019 · 1 comment

Comments

@marjan-georgiev
Copy link

@marjan-georgiev marjan-georgiev commented Dec 2, 2019

馃悶 bug report

Affected Package

The issue is caused by package @angular/core

Is this a regression?

Yes, the previous version in which this bug was not present was: 8.x

Description

Some components in ngx-charts use HTML tags inside an svg:foreignObject element in order to render HMTL inside SVG.
Example:

<svg width="500" height="500">
   <svg:foreignObject width="500" height="500">
      <xhtml:div>Hello</xhtml:div>
   </svg:foreignObject>
</svg>

Compiling these components with Ivy enabled on angular 9.0.0-rc.4 throws an error:

TS8001: ':xhtml:div' is not a known element:

Note: <div>Hello</div> doesn't work neither, since Ivy tries to resolve it as :svg:div, which is also not a known element.

馃敩 Minimal Reproduction

https://github.com/marjan-georgiev/ivy-html-in-svg

馃敟 Exception or Error

ERROR in app/app.component.ts:9:7 - error TS8001: ':xhtml:div' is not a known element:
1. If ':xhtml:div' is an Angular component, then verify that it is part of this module.
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

9       <xhtml:div>Hello</xhtml:div>
        ~~~~~~~~~~~

馃實 Your Environment

Angular Version:




     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / 鈻 \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.0.0-rc.4
Node: 12.3.1
OS: darwin x64

Angular: 9.0.0-rc.4
... cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.0-rc.4
@angular-devkit/build-angular     0.900.0-rc.4
@angular-devkit/build-optimizer   0.900.0-rc.4
@angular-devkit/build-webpack     0.900.0-rc.4
@angular-devkit/core              9.0.0-rc.4
@angular-devkit/schematics        9.0.0-rc.4
@ngtools/webpack                  9.0.0-rc.4
@schematics/angular               9.0.0-rc.4
@schematics/update                0.900.0-rc.4
rxjs                              6.5.3
typescript                        3.6.4
webpack                           4.41.2

Anything else relevant?

@crisbeto crisbeto self-assigned this Dec 2, 2019
crisbeto added a commit to crisbeto/angular that referenced this issue Dec 2, 2019
Fixes ngtsc incorrectly logging an unknown element diagnostic for HTML elements that are inside an SVG `foreignObject` with the `xhtml` namespace.

Fixes angular#34171.
@ngbot ngbot bot modified the milestone: needsTriage Dec 2, 2019
crisbeto added a commit to crisbeto/angular that referenced this issue Dec 2, 2019
Fixes ngtsc incorrectly logging an unknown element diagnostic for HTML elements that are inside an SVG `foreignObject` with the `xhtml` namespace.

Fixes angular#34171.
crisbeto added a commit to crisbeto/angular that referenced this issue Dec 2, 2019
Fixes ngtsc incorrectly logging an unknown element diagnostic for HTML elements that are inside an SVG `foreignObject` with the `xhtml` namespace.

Fixes angular#34171.
crisbeto added a commit to crisbeto/angular that referenced this issue Dec 2, 2019
Fixes ngtsc incorrectly logging an unknown element diagnostic for HTML elements that are inside an SVG `foreignObject` with the `xhtml` namespace.

Fixes angular#34171.
crisbeto added a commit to crisbeto/angular that referenced this issue Dec 2, 2019
Fixes ngtsc incorrectly logging an unknown element diagnostic for HTML elements that are inside an SVG `foreignObject` with the `xhtml` namespace.

Fixes angular#34171.
crisbeto added a commit to crisbeto/angular that referenced this issue Dec 2, 2019
Fixes ngtsc incorrectly logging an unknown element diagnostic for HTML elements that are inside an SVG `foreignObject` with the `xhtml` namespace.

Fixes angular#34171.
@mhevery mhevery closed this in e6909bd Dec 3, 2019
mhevery added a commit that referenced this issue Dec 3, 2019
)

Fixes ngtsc incorrectly logging an unknown element diagnostic for HTML elements that are inside an SVG `foreignObject` with the `xhtml` namespace.

Fixes #34171.

PR Close #34178
@angular-automatic-lock-bot

This comment has been minimized.

Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Jan 3, 2020

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.