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.

Error when creating widget.

See original GitHub issue

When trying to import StringWidget (or any other widget) it gives me an error: Type 'any' is not a constructor function type. on the last line.

import { Component } from '@angular/core';
import { StringWidget } from 'angular2-schema-form';

@Component({
  selector: 'mdl-sf-string-widget',
  templateUrl: './string.widget.html'
})

export class MyStringWidget extends StringWidget {}

How should I resolve this error?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
davidsennekoolcommented, Mar 16, 2017

It’s working! Thanks a lot 😄

0reactions
ebrehaultcommented, Mar 16, 2017

Add declare var require: any; in your src/typings.d.ts and the compiler should be happy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Widget error: 'We were unable to build your widget'
Widget error: 'We were unable to build your widget' ... This error can occur when someone makes a change to the connection powering...
Read more >
Custom in-panel widget, create widget error - Esri Community
The first error occurs when assigning the widget to Header-Controller, the second appears when trying to open the widget. Reply.
Read more >
Error creating widget: could not find model #2125 - GitHub
I'm trying to build on jupyterlab-0.32.1, but something is not working anymore. see ... Error creating widget: could not find model #2125.
Read more >
ErrorWidget class - widgets library - Flutter - Dart API docs
A widget that renders an exception's message. This widget is used when a build method fails, to help with determining where the problem...
Read more >
null safety error when creating Flutter classes and widgets
I am learning Flutter / Dart and when doing the exercise in this video I have encountered an error that from what ...
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