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.

"TypeError: this.options.changes.startWith is not a function" with Enum

See original GitHub issue

New to A2JSF. Trying to do basic example. I have an enum schema object: "status": { "type": "string", "enum": [ "Draft", "Published" ], "title": "Status" }, Whenever I have such an enum, I get this error: ERROR TypeError: this.options.changes.startWith is not a function at MdSelect.webpackJsonp.../../../../angular2-json-schema-form/angular2-json-schema-form.es5.js.MdSelect.ngAfterContentInit (angular2-json-schema-form.es5.js:50477) at callProviderLifecycles (core.es5.js:11234) at callElementProvidersLifecycles (core.es5.js:11215) at callLifecycleHooksChildrenFirst (core.es5.js:11199) at checkAndUpdateView (core.es5.js:12291) at callViewAction (core.es5.js:12651) at execComponentViewsAction (core.es5.js:12583) at checkAndUpdateView (core.es5.js:12294) at callViewAction (core.es5.js:12651) at execEmbeddedViewsAction (core.es5.js:12609) The pull-down is rendered. It responds to initial click by pulling-down, and is otherwise unresponsive. Have A2JSF 0.4.0-alpha.16 and rxjs (with startWith) 5.4.1.

Maybe something dumb on my end, but I can’t see it. Helpl! John

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
danmanacommented, Aug 31, 2017

Try adding import 'rxjs/add/operator/startWith'; to your components which use json-schema-form, it worked for me (note: I am using material-design).

0reactions
dschnelldaviscommented, Oct 24, 2017

Yes, unfortunately, a current limitation of this library is that it requires the @angular/material and @angular/cdk packages be installed, even if you only want to display your form using the Bootstrap framework. This will be fixed in a future version, and until then is being tracked as bug #67 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I guarantee that my enums definition doesn't change ...
I really like this although I'm not a big fan of mucking up Object space (with global function ENUM). Converted this to a...
Read more >
next/jest feedback · Discussion #31152 · vercel/next.js - GitHub
It throws an error while running tests, stating that hello.mockReturnValue() is not a function. Here is the test for reference. import { render, ......
Read more >
TypeError: startsWith is not a function in JavaScript | bobbyhadz
The "startsWith is not a function" error occurs when we call the startsWith() method on a value that is not a string. To...
Read more >
TypeScript enums: How do they work? What can they be used ...
This blog post answers the following two questions: How do TypeScript's enums work? What can they be used for?
Read more >
TypeScript Tutorial: What is, Interface, Enum, Array with Example
In this TypeScript tutorial, you will learn What is TypeScript, TypeScript Arrays, Class, Interface, Functions, Enum, and Namespaces with ...
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