1
votes

We have an angular / ionic app using typescript with the raygun library installed. Until today it has been building fine, just today I have started getting the following error when building

"Cannot invoke an expression whose type lacks a call signature. Type 'RaygunStatic' has no compatible call signatures."

This happens on the following line of code

rg4js('setUser', {

At the top of the file I have

import * as rg4js from 'raygun4js';

I am compiling the exact same code from git a week ago that was working. I am facing the same error locally and when running the build on ionic pro, which is extra strange as therefore it shouldn't be down to a version of anything on my machine changing since it was working a week ago in ionic framework and now it isn't, with nothing changing in the code.

Something has changed, but I can't figure out what.

I've reached out to raygun and they said:

We do know that there are some issues with the definitions not exporting all the correct information and we hope to fix this in the future.

But I don't see why it would have worked last week and not today. I haven't changed the version of the raygun library.

Any help appreciated.

Cheers, Rob

1

1 Answers

2
votes

A not so nice "fix" for this temporarily would be to mark the rg4js usage as any. Then the complier will ignore type-checking for this usage.

(rg4js as any)('user', {...

As to why it did work before and doesn't anymore I don't know. I've experienced the type checking saying everything was fine and complying when there was a bug but didn't look into it further at the time.