Getting a run time error Object(..) not a function.how can i fix it

#1

Getting a run time error Object(…) not a function.how can i fix it.

#2

Don’t treat things that are not functions as functions.

#3

@rapropos this error show in vendor. js
like that

vendor.js (line 77021, col 1)

#4

There are two possibilities:

  • there is a bug in Ionic that would cause every single application to fail with the exact same error you are seeing
  • something is wrong in your code, which you have not provided anybody in order to try to help you

Which do you think is more likely?

#5

@rapropos my code is working fine few minutes ago.suddenly happen this things .i dont know what should i do

#6

Think about it from the perspective of somebody trying to help you. What would you need to do so?

#7

Having the exact same problem.
IONIC CLI 3.9.2 (recently updated)
ionic-error

It throws an error in a service of my App, but I wasn’t even touching that code. It just happened while I was modifying a form elsewhere.

Also, stopping ionic serve and restarting works. What I want to know if it’s my fault or it’s a bug of the CLI or the ionic version (3.6.0)

Thanks.

#8

Issue still persists in 3.12.0. Sometimes it works again after another save, but it seems random at this point.
I’d wager it is the CLI. The fact it’s an intermittent issue doesn’t indicate user error.

#9

It very odd…
I also encounter the same issue, every time I edit something in any Ts file.

I found a simple solution, whenever an issue occurs i just go to page Ts file & select whole code, then ctrl+x to cut.
Then ctrl+s to save
Then ctrl+v to paste the code same place…

Magically error disappears.

I don’t exactly how & what causes it

I would appreciate if someone has permanent solution to this

1 Like
#10

installing rxjs compat works

npm i rxjs@6 rxjs-compat@6 promise-polyfill --save

#11

This also works for me … strange!
Seems CLI issue

1 Like
#12

Its happend to me,
Maybe you are using in your project ionic 3 , and you installing plugins of ionic version 4, if you are using ionic 3 ,try to install your plugins from https://ionicframework.com/docs/v3/.

2 Likes