Skip to content

bug(ivy): runtime error for unknown element even with NO_ERRORS_SCHEMA #33976

Closed

Description

@petebacondarwin

The ivy runtime throws an error if there is an unknown element, even if the NgModule contains the NO_ERRORS_SCHEMA.

See the reproduction here:

git clone https://github.com/petebacondarwin/ivy-schema-test && cd ivy-schema-test && npm i && npm start -o

Open console in the browser to see the error:

core.js:6068 ERROR Error: 'some-element' is not a known element:
1. If 'some-element' is an Angular component, then verify that it is part of this module.
2. If 'some-element' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
    at validateElement (core.js:23517)
    at ɵɵelementStart (core.js:23323)
    at Module.ɵɵelement (core.js:23389)
    at AppComponent_Template (app.component.html:2)
    at executeTemplate (core.js:13880)
    at renderView (core.js:13682)
    at renderComponent (core.js:15111)
    at renderChildComponents (core.js:13484)
    at renderView (core.js:13708)
    at ComponentFactory$1.create (core.js:34077)

The AppComponent template looks like:

<div>
  <some-element></some-element>
</div>

but the AppModule has the NO_ERRORS_SCHEMA:

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule
  ],
  providers: [],
  schemas: [NO_ERRORS_SCHEMA],
  bootstrap: [AppComponent]
})
export class AppModule { }

Note that if you remove the NO_ERRORS_SCHEMA then the build fails, as expected, during AOT compile time.

This looks like a regression that was introduced by c83f501

Activity

  1. added this to the needsTriage milestone on Nov 21, 2019
  2. IgorMinar commented on Nov 27, 2019

    @IgorMinar
    Contributor

    fixed by #34024

  3. angular-automatic-lock-bot commented on Dec 28, 2019

    @angular-automatic-lock-bot

    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.

  4. locked and limited conversation to collaborators on Dec 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

regressionIndicates than the issue relates to something that worked in a previous versionstate: has PRtype: bug/fix

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions