Error: Uncaught Typeerror: Object(...) is not a Function

Asked

Viewed 1,036 times

1

I am developing an application using Cordova + Ionic + Angular, but I have the following problem. From one minute to the next started giving the following error in Chrome:

Uncaught Typeerror: Object(...) is not a Function At object. (ngx-echarts.js:162) at webpack_require (bootstrap cc523015242fafcdd7ed:54) At Object.650 (main.ts:7) at webpack_require (bootstrap cc523015242fafcdd7ed:54) At Object.645 (main.js:2673) at webpack_require (bootstrap cc523015242fafcdd7ed:54) at webpackJsonpCallback (bootstrap cc523015242fafcdd7ed:25) at main.js:1

In SAFARI the same error is displayed this way:

inserir a descrição da imagem aqui

For inspecting item no browser, to realize that this error is in the file ngx-echarts.js line 162. This file is part of a graphics plugin, the ngx-echarts. The compilation on the Android platform is working perfectly, however this problem is happening IOS. As it generates a build error, I can’t even install the app on the device.

These are my settings:

  • Ionic Framework: 3.7.0
  • Ionic Native: 2.9.0
  • Ionic App Scripts: 3.1.9
  • Angular Core: 4.4.3
  • Angular Compiler CLI: 4.4.3 Node: 8.9.3 OS
  • Platform: macOS High Sierra Navigator
  • Platform: Macintel
  • User Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) Applewebkit/602.1.50 (KHTML, like Gecko) Crios/56.0.2924.75 Mobile/14E5239e Safari/602.1

Has anyone ever been through this problem? Do you know if this is a bug or something like that? How can I be solving?

  • Tried to finish the server and clear the "www" folder (which is automatically generated)?

  • @I just did that, but nothing. =/

  • How did you add the ngx-echarts? Installed npm install echarts --save and npm install ngx-echarts --save? Added in imports: [...] the module NgxEchartsModule? Added the echarts in new webpack.ProvidePlugin({ echarts: "echarts",... ?

  • Only the new webpack of your questions I did not ask, as I did not find the file to add this code snippet. Do you have any idea?

  • I’m not sure, but I think I can create a webpack.config.js in your project’s root folder. I’m going to try something to see if I can help you.

  • @Guilhermenascimento found this file webpack.config.js inside @ionic/app-script/config/webpack.config.js, ai added in plugins, but in the documentation of the link I sent tell to add in the file webpack.common.js . The funny thing is that on Android did not need this setting. Only the MAC has this freshness.

  • I was pretty sure that when running the NPM command it added this itself, so common is what will be "copied" to everyone if I’m not mistaken, config is from the project. But I’m not sure. I have to take a closer look at the Angular doc to make sure I’m not confused

  • @Guilhermenascimento So! For me this file should be there, but not this. When you can look, give me a touch. I have to solve this soon. affe =/

  • @Guilhermenascimento edited and added the error that appears in SAFARI

  • Gee, it’s like a BUG or lack of update, I can’t tell if it’s npm or webpack.

Show 5 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.