Skip to content

NullInjectorError: No provider for Framework! #340

@AdamSundberg

Description

@AdamSundberg

Describe the bug
I'm using Angular 14's new feature 'standalone' components. When importing the JsonSchemaFormModule and using the json-scheme-form component in the template I get NullInjectorError (see attached file).

Error:
ERROR NullInjectorError: R3InjectorError(Standalone[PlaygroundComponent])[FrameworkLibraryService -> FrameworkLibraryService -> FrameworkLibraryService -> Framework -> Framework]:

  • MaterialDesignFrameworkModule — Material Design
  • Bootstrap3FrameworkModule — Bootstrap 3
  • Bootstrap4FrameworkModule — Bootstrap 4
  • NoFrameworkModule — plain HTML
  • Other (please specify below)

To Reproduce
Steps to reproduce the behavior:

  1. Install Angular 14
  2. Generate a standalone component
  3. Import the JsonSchemaFormModule
  4. Add the json-scheme-form to the component template
  5. Try to view it in the browser

Expected behavior
I expect to see the Json form.

Screenshots
The error:
image

The standalone component:
image

The component template:
image

Desktop (please complete the following information):

  • OS: macOS Monterey 12.6
  • Browser: Tested firefox and safari

Log output covering before error and any error statements

ERROR NullInjectorError: R3InjectorError(Standalone[PlaygroundComponent])[FrameworkLibraryService -> FrameworkLibraryService -> FrameworkLibraryService -> Framework -> Framework]: 
  NullInjectorError: No provider for Framework!
    Angular 5
    FrameworkLibraryService_Factory ajsf-core.mjs:2294
    Angular 8
    JsonSchemaFormComponent_Factory ajsf-core.mjs:2294
    Angular 5
    BlockConfigComponent_Template block-config.component.html:1
    Angular 12
    SidePanelEditorComponent_Template side-panel-editor.component.html:2
    Angular 23
    RxJS 6
    Angular 22
    BaseBlockComponent_HostBindings base-block.component.ts:14
    Angular 4
    CanvasComponent__svg_g_4_Template canvas.component.html:12
    Angular 13
    CanvasComponent_Template canvas.component.html:27
    Angular 23
[core.mjs:7635:22](webpack:///node_modules/@angular/core/fesm2020/core.mjs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions