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.

Issue when importing the ng2-tag-input module.

See original GitHub issue

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

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

Current behavior On version 1.0.1, whenever the ng2-tag-input module is loaded, I’m getting the following error:

ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'setGlobalVar' of null
TypeError: Cannot read property 'setGlobalVar' of null
    at _createNgProbe (ng2-tag-input.bundle.js:8521)
    at BotIdeModuleInjector.createInternal (module.ngfactory.js:176)
    at BotIdeModuleInjector.NgModuleInjector.create (core.es5.js:3557)
    at NgModuleFactory.create (core.es5.js:3530)
    at MapSubscriber.project (router.es5.js:523)
    at MapSubscriber._next (map.js:77)
    at MapSubscriber.Subscriber.next (Subscriber.js:89)
    at PromiseObservable.js:66
    at ZoneDelegate.invoke (zone.js:365)
    at Object.onInvoke (core.es5.js:4145)
    at ZoneDelegate.invoke (zone.js:364)
    at Zone.run (zone.js:125)
    at zone.js:760
    at ZoneDelegate.invokeTask (zone.js:398)
    at Object.onInvokeTask (core.es5.js:4136)
    at _createNgProbe (ng2-tag-input.bundle.js:8521)
    at BotIdeModuleInjector.createInternal (module.ngfactory.js:176)
    at BotIdeModuleInjector.NgModuleInjector.create (core.es5.js:3557)
    at NgModuleFactory.create (core.es5.js:3530)
    at MapSubscriber.project (router.es5.js:523)
    at MapSubscriber._next (map.js:77)
    at MapSubscriber.Subscriber.next (Subscriber.js:89)
    at PromiseObservable.js:66
    at ZoneDelegate.invoke (zone.js:365)
    at Object.onInvoke (core.es5.js:4145)
    at ZoneDelegate.invoke (zone.js:364)
    at Zone.run (zone.js:125)
    at zone.js:760
    at ZoneDelegate.invokeTask (zone.js:398)
    at Object.onInvokeTask (core.es5.js:4136)
    at resolvePromise (zone.js:712) [angular]
    at resolvePromise (zone.js:683) [angular]
    at polyfills.bundle.js:7225:17 [angular]
    at Object.onInvokeTask (core.es5.js:4136) [angular]
    at ZoneDelegate.invokeTask (zone.js:397) [angular]
    at Zone.runTask (zone.js:165) [<root> => angular]
    at drainMicroTaskQueue (zone.js:593) [<root>]

This error is occurring in the core codebase, as well as when trying to inject ng2-tag-input in any tests.

This was not occurring as of the previous version I was using (0.9.10)

Expected behavior The module loads correctly.

Minimal reproduction of the problem with instructions Create a module that imports ng2-tag-input, either in tests or in code.

Here is an example module that is failing:

import { TagInputModule } from 'ng2-tag-input';
import { RendererSettingsComponent } from './renderer-settings/renderer-settings.component';
import { RendererPermissionsComponent } from './renderer-permissions/renderer-permissions.component';
import { RendererOverviewComponent } from './renderer-overview/renderer-overview.component';
import { rendererIdeRouting } from './renderer-ide.routes';
import { RendererResolve } from './shared/renderer-resolve.service';
import { RenderersService } from '../../shared/renderers.service';
import { CoreService } from './../../shared/core-service.model';
import { CoreIdeModule } from './../../core-ide/core-ide.module';
import { NgModule }       from '@angular/core';
import { CommonModule }       from '@angular/common';
import { FormsModule } from '@angular/forms';
import { ModalModule } from 'ng2-bootstrap';

@NgModule({
    declarations: [
      RendererOverviewComponent,
      RendererPermissionsComponent,
      RendererSettingsComponent
    ],
    imports: [
      CommonModule,
      CoreIdeModule,
      FormsModule,
      ModalModule,
      TagInputModule,
      rendererIdeRouting
      ],
    providers: [
      RendererResolve,
      {provide: CoreService, useExisting: RenderersService},
      RenderersService
    ],
})
export class RendererIdeModule { }

Here is an example of an import in a test that is failing:

    TestBed.configureTestingModule({
      declarations: [
        RendererSettingsComponent
      ],
      imports: [
          RouterTestingModule,
          TagInputModule,
          FormsModule,
          ModalModule.forRoot()
      ],
      providers: [
        {provide: ActivatedRoute, useValue: routerStub },
        {provide: CoreService, useValue: renderersServiceStub},
        {provide: ImagesService, useValue: imagesServiceStub}
      ]
    });

What do you use to build your app? (SystemJS, Webpack). Please specify the version Using 1.0.0 of the angular-cli tool (webpack)

  • Angular version: 4.0.0

  • Browser: Chrome and PhantomJS

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Gbuompriscocommented, Mar 28, 2017

Closing this 😃 please reopen if still an issue for anyone

2reactions
soyersoyercommented, Mar 28, 2017

It is working. Thanks. I had to import the BrowserAnimationsModule in the root module, so I think it should be added to the readme.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng2-tag-input separatorKeys not working - Stack Overflow
I am trying to use ng2-tag-input module , with a very basic configuration: import { Component } from '@angular/core'; @Component({ moduleId: module.id, ...
Read more >
ng2-tag-input - npm
Tag Input Component for Angular Build Status ; This component works in Angular 2.4.4. If you have an issues, please do make sure...
Read more >
ng2-tag-input - npm Package Health Analysis | Snyk
Issues not filled out with the provided templates are going to be closed. Configuration. Ensure you import the module: import { TagInputModule }...
Read more >
ngx-chips.fixed - UNPKG
Formerly called ng2-tag-input. ... Open an issue and tag me if you need it to be published. ... 21, Ensure you import the...
Read more >
48 answers on StackOverflow to the most popular Angular ...
Importing lodash into angular2 + typescript application; How to detect a ... Here's a discussion on the Github issues for the Angular docs ......
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