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.

Strange error throw: "ERROR TypeError: defaults$2 is not a constructor"

See original GitHub issue

PLEASE MAKE SURE THAT:

  • you searched similar issues online (9/10 issues in this repo are solved by googling, so please…do it)
  • you provide an online demo I can see without having to replicate your environment
  • you help me by debugging your issue, and if you can’t, do go on filling out this form

I’m submitting a … (check one with “x”)

[x ] bug report => search github for a similar issue or PR before submitting
[ ] support request/question

Notice: feature requests will be ignored, submit a PR if you'd like

Current behavior I have tried all the following

  1. Followed the installation instructions for current version (1.9.8) and the previous version (1.9.7)
  2. Upgraded from Angular 5.2 to 6.1.9
  3. Deleted node_modules and reinstalled from scratch

However I get the following error every time:

ERROR TypeError: defaults$2 is not a constructor
    at new TagInputComponent (ngx-chips.js:1458)
    at createClass (core.js:11729)
    at createDirectiveInstance (core.js:11559)
    at createViewNodes (core.js:13100)
    at createEmbeddedView (core.js:12959)
    at callWithDebugContext (core.js:14460)
    at Object.debugCreateEmbeddedView [as createEmbeddedView] (core.js:13740)
    at TemplateRef_.createEmbeddedView (core.js:11064)
    at ViewContainerRef_.createEmbeddedView (core.js:10845)
    at NgIf._updateView (common.js:3878)

With line 1458 looking like:

this.separatorKeys = new defaults$2().separatorKeys;

Expected behavior I would expect no error and the component to render. My assumption is either a version clash or I am not initialising the library properly.

Minimal reproduction of the problem with instructions (if applicable)

What do you use to build your app?. Please specify the version Angular CLI, output from np --version

Angular CLI: 6.2.5 Node: 10.11.0 OS: win32 x64 Angular: 6.1.9 … animations, common, compiler, compiler-cli, core, forms … http, language-service, platform-browser … platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.8.5 @angular-devkit/build-angular 0.8.5 @angular-devkit/build-optimizer 0.8.5 @angular-devkit/build-webpack 0.8.5 @angular-devkit/core 0.8.4 @angular-devkit/schematics 0.8.5 @angular/cdk 6.4.7 @angular/cli 6.2.5 @angular/material 6.4.7 @ngtools/webpack 6.2.5 @schematics/angular 0.8.5 @schematics/update 0.8.5 rxjs 6.3.3 typescript 2.9.2 webpack 4.20.2

Angular version: 6.1.9

ngx-chips version: 1.9.8 and 1.9.7

Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] Latest version of Chrome

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ashish-sharma91commented, May 31, 2019

I am also having the same issue after Upgrading Angular 8, “target”: “es5”, doesnt solve the issue in my case.

1reaction
webcat12345commented, May 29, 2019

having same error after upgrading to angular 8, chips version is - “ngx-chips”: “^2.0.0-beta.0”, resolved issue with this - "target": "es5",

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: "x" is not a constructor - JavaScript - MDN Web Docs
The JavaScript exception "is not a constructor" occurs when there was an attempt to use an object or a variable as a constructor,...
Read more >
Error: *.default is not a constructor - Stack Overflow
You need to export a default value which will look like: export default class MapAction implements IMapAction {... And import it as:
Read more >
Resolving TypeError: "X" is Not a Constructor in JavaScript
JavaScript "TypeError: "x" is not a constructor" errors occur when invalid objects or a variable is erroneously used as a constructor.
Read more >
I get an error: TypeError: Penguin is not a constructor
I get an error: TypeError: Penguin is not a constructor. Here is my code: // the original Animal class and sayName method function...
Read more >
Built-in Exceptions — Python 3.11.1 documentation
error have been merged into OSError , and the constructor may return a subclass. Changed in version 3.4: The filename attribute is now...
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