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.









share|improve this question
























  • 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/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















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.









share|improve this question
























  • 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/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













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.









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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


















  • 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/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
















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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues