hamzahamidi / ajsf

Angular JSON Schema Form
https://hamzahamidi.github.io/ajsf
MIT License
363 stars 184 forks source link

NullInjectorError: No provider for Framework! #340

Open AdamSundberg opened 1 year ago

AdamSundberg commented 1 year ago

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]:

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):

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)
LadaBr commented 1 year ago

Exactly same happens to me.