D3 Angular - error TS2349: Cannot invoke an expression whose type lacks a call signature. Type
up vote
0
down vote
favorite
I have a stackBlitz here -
https://stackblitz.com/edit/ng-divided-bar?embed=1&file=src/app/bar-chart.ts&hideNavigation=1
I have a d3 chart here in Angular.
Everything works here but in my actual app I'm getting the error
error TS2349: Cannot invoke an expression whose type lacks a call signature. Type
which relates to this code.
this.y.domain(
d3.extent(
d3.extent(data, (d) => {
return d.start;
})
.concat(d3.extent(data, (d) => {
return d.finish;
})
)
));
My actual app uses Typescript 2.7.2
Is this it do with the way I'm importing D3
import * as d3 from 'd3';
If I remove the d3 import the error stops but I don't know how else to import d3
The full error is
ERROR in .component.ts(108,7): error TS2349: C
annot invoke an expression whose type lacks a call signature.
Type '{ (...items: ConcatArray<string>): string;
(...items: (string | ConcatArray<string>)): stri...' has no compatible call signatures.
angular d3.js
add a comment |
up vote
0
down vote
favorite
I have a stackBlitz here -
https://stackblitz.com/edit/ng-divided-bar?embed=1&file=src/app/bar-chart.ts&hideNavigation=1
I have a d3 chart here in Angular.
Everything works here but in my actual app I'm getting the error
error TS2349: Cannot invoke an expression whose type lacks a call signature. Type
which relates to this code.
this.y.domain(
d3.extent(
d3.extent(data, (d) => {
return d.start;
})
.concat(d3.extent(data, (d) => {
return d.finish;
})
)
));
My actual app uses Typescript 2.7.2
Is this it do with the way I'm importing D3
import * as d3 from 'd3';
If I remove the d3 import the error stops but I don't know how else to import d3
The full error is
ERROR in .component.ts(108,7): error TS2349: C
annot invoke an expression whose type lacks a call signature.
Type '{ (...items: ConcatArray<string>): string;
(...items: (string | ConcatArray<string>)): stri...' has no compatible call signatures.
angular d3.js
i do not see any errors in the stackblitz link , can you check ?
– Mohamed Ali RACHID
Nov 10 at 21:01
This is my reason for the question. The Stackblitz shows no error and works but my actual app (I can't show a link) has the error. I know this question is vague but I was hoping someone might have seen this error before and offer some advise
– ttmt
Nov 10 at 21:05
can you please update the full error in your post ?
– Mohamed Ali RACHID
Nov 10 at 21:10
Check your tsconfig.json, in your local project, do you have the compiler optionsesModuleInterop
and/orallowSyntheticDefaultImports
set to true? In that case, change the import toimport d3 from 'd3';
.
– pascalpuetz
Nov 10 at 21:10
@pascalpuetz I have tried this but I'm still getting the same error
– ttmt
Nov 11 at 7:09
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a stackBlitz here -
https://stackblitz.com/edit/ng-divided-bar?embed=1&file=src/app/bar-chart.ts&hideNavigation=1
I have a d3 chart here in Angular.
Everything works here but in my actual app I'm getting the error
error TS2349: Cannot invoke an expression whose type lacks a call signature. Type
which relates to this code.
this.y.domain(
d3.extent(
d3.extent(data, (d) => {
return d.start;
})
.concat(d3.extent(data, (d) => {
return d.finish;
})
)
));
My actual app uses Typescript 2.7.2
Is this it do with the way I'm importing D3
import * as d3 from 'd3';
If I remove the d3 import the error stops but I don't know how else to import d3
The full error is
ERROR in .component.ts(108,7): error TS2349: C
annot invoke an expression whose type lacks a call signature.
Type '{ (...items: ConcatArray<string>): string;
(...items: (string | ConcatArray<string>)): stri...' has no compatible call signatures.
angular d3.js
I have a stackBlitz here -
https://stackblitz.com/edit/ng-divided-bar?embed=1&file=src/app/bar-chart.ts&hideNavigation=1
I have a d3 chart here in Angular.
Everything works here but in my actual app I'm getting the error
error TS2349: Cannot invoke an expression whose type lacks a call signature. Type
which relates to this code.
this.y.domain(
d3.extent(
d3.extent(data, (d) => {
return d.start;
})
.concat(d3.extent(data, (d) => {
return d.finish;
})
)
));
My actual app uses Typescript 2.7.2
Is this it do with the way I'm importing D3
import * as d3 from 'd3';
If I remove the d3 import the error stops but I don't know how else to import d3
The full error is
ERROR in .component.ts(108,7): error TS2349: C
annot invoke an expression whose type lacks a call signature.
Type '{ (...items: ConcatArray<string>): string;
(...items: (string | ConcatArray<string>)): stri...' has no compatible call signatures.
angular d3.js
angular d3.js
edited Nov 10 at 21:55
asked Nov 10 at 20:36
ttmt
1,973114995
1,973114995
i do not see any errors in the stackblitz link , can you check ?
– Mohamed Ali RACHID
Nov 10 at 21:01
This is my reason for the question. The Stackblitz shows no error and works but my actual app (I can't show a link) has the error. I know this question is vague but I was hoping someone might have seen this error before and offer some advise
– ttmt
Nov 10 at 21:05
can you please update the full error in your post ?
– Mohamed Ali RACHID
Nov 10 at 21:10
Check your tsconfig.json, in your local project, do you have the compiler optionsesModuleInterop
and/orallowSyntheticDefaultImports
set to true? In that case, change the import toimport d3 from 'd3';
.
– pascalpuetz
Nov 10 at 21:10
@pascalpuetz I have tried this but I'm still getting the same error
– ttmt
Nov 11 at 7:09
add a comment |
i do not see any errors in the stackblitz link , can you check ?
– Mohamed Ali RACHID
Nov 10 at 21:01
This is my reason for the question. The Stackblitz shows no error and works but my actual app (I can't show a link) has the error. I know this question is vague but I was hoping someone might have seen this error before and offer some advise
– ttmt
Nov 10 at 21:05
can you please update the full error in your post ?
– Mohamed Ali RACHID
Nov 10 at 21:10
Check your tsconfig.json, in your local project, do you have the compiler optionsesModuleInterop
and/orallowSyntheticDefaultImports
set to true? In that case, change the import toimport d3 from 'd3';
.
– pascalpuetz
Nov 10 at 21:10
@pascalpuetz I have tried this but I'm still getting the same error
– ttmt
Nov 11 at 7:09
i do not see any errors in the stackblitz link , can you check ?
– Mohamed Ali RACHID
Nov 10 at 21:01
i do not see any errors in the stackblitz link , can you check ?
– Mohamed Ali RACHID
Nov 10 at 21:01
This is my reason for the question. The Stackblitz shows no error and works but my actual app (I can't show a link) has the error. I know this question is vague but I was hoping someone might have seen this error before and offer some advise
– ttmt
Nov 10 at 21:05
This is my reason for the question. The Stackblitz shows no error and works but my actual app (I can't show a link) has the error. I know this question is vague but I was hoping someone might have seen this error before and offer some advise
– ttmt
Nov 10 at 21:05
can you please update the full error in your post ?
– Mohamed Ali RACHID
Nov 10 at 21:10
can you please update the full error in your post ?
– Mohamed Ali RACHID
Nov 10 at 21:10
Check your tsconfig.json, in your local project, do you have the compiler options
esModuleInterop
and/or allowSyntheticDefaultImports
set to true? In that case, change the import to import d3 from 'd3';
.– pascalpuetz
Nov 10 at 21:10
Check your tsconfig.json, in your local project, do you have the compiler options
esModuleInterop
and/or allowSyntheticDefaultImports
set to true? In that case, change the import to import d3 from 'd3';
.– pascalpuetz
Nov 10 at 21:10
@pascalpuetz I have tried this but I'm still getting the same error
– ttmt
Nov 11 at 7:09
@pascalpuetz I have tried this but I'm still getting the same error
– ttmt
Nov 11 at 7:09
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243178%2fd3-angular-error-ts2349-cannot-invoke-an-expression-whose-type-lacks-a-call-s%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
i do not see any errors in the stackblitz link , can you check ?
– Mohamed Ali RACHID
Nov 10 at 21:01
This is my reason for the question. The Stackblitz shows no error and works but my actual app (I can't show a link) has the error. I know this question is vague but I was hoping someone might have seen this error before and offer some advise
– ttmt
Nov 10 at 21:05
can you please update the full error in your post ?
– Mohamed Ali RACHID
Nov 10 at 21:10
Check your tsconfig.json, in your local project, do you have the compiler options
esModuleInterop
and/orallowSyntheticDefaultImports
set to true? In that case, change the import toimport d3 from 'd3';
.– pascalpuetz
Nov 10 at 21:10
@pascalpuetz I have tried this but I'm still getting the same error
– ttmt
Nov 11 at 7:09