Software Archive
Read-only legacy content
17061 Discussions

"Module already loaded" after upgrading to 3491

Dario_C_
Beginner
879 Views

Before the last update all my projects where working as a charme. After the upgrade whenever I try to SIMULATE an App I get in the debug console:

"Uncaught module cordova-plugin-splashscreen.SplashScreen already defined cordova.js:79"
"Uncaught module cordova-plugin-device.device already defined cordova.js:79"
"Uncaught module cordova-plugin-statusbar.statusbar already defined ordova.js: 79"

I'm using a HTML5+Cordova newly created project and I can see there is the cordova.js included in the HTML file and one cordova_plugins.js is automatically added *SOMETIMES* while in the Simulation phase.

My index.html contains this headers :

<script src="cordova.js"></script>          <!-- phantom library, needed for Cordova api calls, added during build -->
<script src="js/jquery.js"></script>
<script src="js/app.js"></script>           <!-- recommended location of your JavaScript code relative to other JS files -->
<script src="xdk/init-dev.js"></script>     <!-- normalizes device and document ready events, see README for details -->

And this is how the Simulation debug console looks (when the situation ins with both cordova_files).

This errors appeare both when the Simulator adds cordova.js and cordova_plugins.js, and also when the simulator is including only cordova.js.

The application is correctly recognizing navigator.splashscreen or window.device, but what this series of errors?

Can someone please explain me how to solve this "issue"? Thanks in advance.

0 Kudos
9 Replies
PaulF_IntelCorp
Employee
879 Views

I believe you can safely ignore those errors. I'll ask our simulator expert to take a look at your post.

0 Kudos
Albertina_D_Intel
879 Views

Hi Dario!

These errors appeared also in the previous emulator that was integrated in the Intel XDK, based on Ripple. The only difference was that the console was cleared when you open it, by default. You can safely ignore those errors.

Is your application working correctly under simulation? Or you just were concerned about these errors?

Thank you!

0 Kudos
Dario_C_
Beginner
879 Views

The application works flawlessy (until I put some very personal bugs in it), my concerns where about the unconsistency of the errors and that sporadic "double cordova include" while debugging.

Thanks to both of you for the answers (I really want to let you know I appreciate the work you do on this forum).

0 Kudos
Rafael_S_1
Beginner
879 Views

Thanks for the explanations.
I'm really don't knew this.

But, how can I change cordova_plugins.js?

This file don't show in DEVELOP tab.

codova_plugins_js.png

0 Kudos
Dario_C_
Beginner
879 Views

I think that file is generated by KDX, you just need to manage plugins from the Project tab.

0 Kudos
Rafael_S_1
Beginner
879 Views

humm, ok.

Thanks Dario.

 

 

0 Kudos
PaulF_IntelCorp
Employee
879 Views

Dario is correct. The files cordova.js and cordova_plugins.js are special files that are created by Cordova CLI. They are not meant to be modified by hand nor should they be removed from the Simulate tab's project, they are necessary to make the Simulate tab work as a Cordova application. Your index.html file should have a reference to the cordova.js file, it should not, however, have a direct reference to the cordova_plugins.js file.
 

0 Kudos
Iftikar_K_
Beginner
879 Views

I guess cordova plugin has multiple entries for plugin as i can see on my system.

0 Kudos
Nik_Ahmad_Z_
Beginner
879 Views

I capture window.onerror event so I can log any unexpected bugs.

This error do bother me.

I need to add filter, so not to log this particular bug.

0 Kudos
Reply