question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot set property 'isInputWidget' of undefined.

See original GitHub issue

I’m having the following error when he’s trying to create a form : Cannot set property 'isInputWidget' of undefined at ViewWrappedE…, _nativeError: ZoneAwareError, originalError: TypeError: Cannot set property 'isInputWidget' of undefined at Bootstrap3Component.initializeCon…, context: DebugContext, __zone_symbol__currentTask: ZoneTask…}

My project that has this issue you can find at : https://github.com/Punkiebe/FootballWorld/

Bootstrap is working correctly in my home page, I use json-schema-form in my admin module.

Here a list of the modules I use :

±- @angular/cli@1.0.0-rc.1 ±- @angular/common@2.4.9 ±- @angular/compiler@2.4.9 ±- @angular/compiler-cli@2.4.9 ±- @angular/core@2.4.9 ±- @angular/forms@2.4.9 ±- @angular/http@2.4.9 ±- @angular/platform-browser@2.4.9 ±- @angular/platform-browser-dynamic@2.4.9 ±- @angular/router@3.4.9 ±- @types/jasmine@2.5.38 ±- @types/node@6.0.64 ±- ajv@4.10.0 ±- angular2-json-schema-form@0.3.0-alpha.26 ±- bootstrap@3.3.7 ±- codelyzer@2.0.1 ±- core-js@2.4.1 ±- hammerjs@2.0.8 ±- jquery@3.1.1 ±- rxjs@5.2.0 ±- ts-node@2.0.0 ±- tslint@4.4.2 ±- typescript@2.0.10 `-- zone.js@0.7.8

In my angular-cli config I added this for bootstrap :

"styles": [ "../node_modules/bootstrap/dist/css/bootstrap.css", "styles.css" ], "scripts": ["../node_modules/jquery/dist/jquery.min.js", "../node_modules/bootstrap/dist/js/bootstrap.js"],

Someone an idea what I did wrong to activate the bootstrap framework? In the readme there’s not a lot on how to change frameworks.

Also when I remove [framework]="selectedFramework" I still get the same error.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

4reactions
hoon-kcommented, Oct 11, 2018

This console error problem can be alleviated if you hide the form until you have the schema to set. Something like this:

<json-schema-form loadExternalAssets="false" [schema]="schema" framework="bootstrap-4" (onSubmit)="submit($event)" *ngIf="schema">
</json-schema-form>
0reactions
RichardMViGEMcommented, Apr 20, 2018

I ran into this issue as well, spent an embarrassingly lot of time on it… Anyway, here’s what resolved it for me:

Say you want to use myFormData in your json-shema-form, like this:

<json-schema-form
  [form] = "myFormData"
></json-schema-form>

And you get the content of myFormData from anywhere but “inline definition”, like an external .json file for example If it looks something like this:

myFormData = {
"schema": {
      // your schema definition
    },

    "form": [
      // your form layout definition
    ]
}

in your angular component, myFormData should be declined as follows:

myFormData: any = {
    "schema": {},
    "form": []
  };

I reckon it comes down to when exactly angular renders things and loads variables. My guess is, the <json-schema-form> element is loaded immediately and angular looks up myFormData. It finds something and tries to populate the html-element with content, but lots of stuff is not yet loaded, hence all those nasty error messages. Once asynchronous loading is finished, though, the form is rendered but the error messages are still there. At least that’s what happened to me. Hope this helps someone else out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript - cannot set property of undefined - Stack Overflow
I get the following error: Uncaught TypeError: Cannot set property 'greeting' of undefined. I'm trying to do something similar to an associative ...
Read more >
Cannot set property 'privateKey' of undefined - Box Support
I use the commend box folders:get 0 -vI got this error, but the private.pem exists in the path.Can you help me with the...
Read more >
Cannot set property 'status' of undefined - Browser
Recently we got a spike in javascript error “Cannot set property 'status' of undefined” from the newrelic script on 06.02.2021.
Read more >
JavaScript error -- Uncaught TypeError: Cannot set property ...
Hey Paul,. Is this error popping up in a window while working with the template in the UI, or is it simply being...
Read more >
ConnectWise Manage Error: "Cannot set property 'board/id' of ...
ConnectWise Manage Error: "Cannot set property 'board/id' of undefined" ... when I try and test I receive this error. I do not understand...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found