Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subject is not a constructor #9

Closed
MoreThanCarbon opened this issue Apr 5, 2017 · 7 comments
Closed

Subject is not a constructor #9

MoreThanCarbon opened this issue Apr 5, 2017 · 7 comments

Comments

@MoreThanCarbon
Copy link

I can't seem to get rid of this error when I use the component. It doesn't seem to like that the service uses the 'Subject' from rxjs as a constructor, i.e. 'new Subject()';

ERROR TypeError: Subject_1.Subject is not a constructor
    at new ContextMenuService (contextMenu.service.js:23)
    at FakeModuleInjector.get (module.ngfactory.js:144)
    at FakeModuleInjector.getInternal (module.ngfactory.js:256)
    at FakeModuleInjector.NgModuleInjector.get (ng_module_factory.ts:141)
    at resolveDep (provider.ts:504)
    at createClass (provider.ts:371)
    at createDirectiveInstance (provider.ts:192)
    at createViewNodes (view.ts:290)
    at callViewAction (view.ts:699)
    at execComponentViewsAction (view.ts:643)
    at createViewNodes (view.ts:355)
    at Object.createEmbeddedView (view.ts:208)
    at TemplateRef_.createEmbeddedView (refs.ts:519)
    at ViewContainerRef_.createEmbeddedView (refs.ts:274)
    at NgIf._updateView (ng_if.ts:159)
@isaacplmann
Copy link
Owner

I can't figure out how to reproduce this.

What version of rxjs are you using? And what version of Angular? It would be really helpful if you could make a small github repository that reproduced this.

@MoreThanCarbon
Copy link
Author

Rxjs 5.3.0 (but it does the same with 5.2.0) and Angular 4.0.1

@isaacplmann
Copy link
Owner

Hm. I just created a sample app that works without this error. https://github.com/isaacplmann/ngx-contextmenu-test

Can you modify this one or make your own that demonstrates the problem?

@MoreThanCarbon
Copy link
Author

I finally figured out where the problem lies, however, I am not sure what the resolution is. I am using a Node.js server and I am using systemjs to load my modules. There is some type of breaking change that happened after systemjs@0.20.0-rc.1 that is currently incompatible with ngx-contextmenu.

@isaacplmann
Copy link
Owner

Ah, so you're using systemjs to build. I'm not using that myself, so I'm afraid I'm not supporting it as well as I do webpack builds. Issue #5 should help resolve this somewhat, once I get around to it.

I found an issue filed against the angular cli that might be related to what you're experiencing. Let me know if you find a solution or if you have any guidance for how I can better package the library. (PRs are always welcome.)

@isaacplmann
Copy link
Owner

Closing this in favor of #5

@nnrthota
Copy link

"rxjs": "^5.2.0"
Problem with version of rxjs just change and do npm install, error will fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants