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.

Angular 6 library compile error: Directive NbContextMenuDirective, Expected 0 arguments, but got 1.

See original GitHub issue

Issue type

I’m submitting a …

  • bug report
  • feature request

Issue description

Current behavior:

Can’t compile angular 6 library using NbContextMenuDirective got the error : projects/demo/src/lib/demo.component.ts.DemoComponent.html(4,7): : Directive NbContextMenuDirective, Expected 0 arguments, but got 1.

Expected behavior:

Should compile 😄

Steps to reproduce:

git clone https://github.com/osixia/nebular-bug
cd nebular-bug
npm install
ng build demo

Related code:

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'lib-demo',
  template: `
    <p>
      demo works!
      <button [nbContextMenu]="items">Click me</button>
    </p>
  `,
  styles: []
})
export class DemoComponent implements OnInit {

  items = [{ title: 'Profile' }, { title: 'Log out' }];

  constructor() { }

  ngOnInit() {
  }

}

Other information:

npm, node, OS, Browser

node --version
v8.10.0

npm --version
6.2.0

Angular, Nebular

"@angular/core": "^6.0.3",
[...]
"@nebular/theme": "^2.0.0-rc.10",

"ng-packagr": "^3.0.0-rc.2" and "ng-packagr": "^4.1.0", tested with same result

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

2reactions
nnixaacommented, Sep 17, 2018

@BertrandGouny thanks! Here is the reason https://github.com/akveo/nebular/blob/2.0.0-rc.10/src/framework/theme/components/context-menu/context-menu.directive.ts#L168 and here is the explanation https://stackoverflow.com/a/50409526/6272699.

Since we rework the popover based components quite a lot since the previous RC, we need to check if this is still the case.

On a side note, the demo component is missing <nb-layout><nb-layout-column>...</ which are required by Nebular.

0reactions
nnixaacommented, Sep 30, 2018

@arabbani next week!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 6 - Directive SomeComponent, Expected 0 arguments ...
I meet some similar error called ERROR in (1,1): : Directive SomeComponent, Expected 0 arguments, but got 1. as described inside this ...
Read more >
Expected 0 arguments, but got 1 error in TypeScript | bobbyhadz
The error "Expected 0 arguments, but got 1" occurs when we pass an argument to a function that doesn't take any arguments. To...
Read more >
The "Expected 0 arguments, but got 1." errors occur when ...
I updated the devextreme libraries to 17.2.4 version and now everytime I try to build with -prod parameter, this error appears: ERROR in...
Read more >
Realm.App({id: ''}) | Expected 0 arguments, but got 1.ts(2554)
I installed Realm using npm install --save realm@10.0.0-beta.6 , as directed by the Install Realm for Node.js guide. Lauren_Schaefer (Lauren ...
Read more >
Expected 0 arguments, but got 1.ts(2554)-angular.js
Coding example for the question Service Error : Expected 0 arguments, but got 1.ts(2554)-angular.js.
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