Software Archive
Read-only legacy content
17061 ディスカッション

"Module already loaded" after upgrading to 3491

Dario_C_
ビギナー
1,875件の閲覧回数

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 件の賞賛
9 返答(返信)
PaulF_IntelCorp
従業員
1,875件の閲覧回数

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

Albertina_D_Intel
従業員
1,875件の閲覧回数

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!

Dario_C_
ビギナー
1,875件の閲覧回数

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

Rafael_S_1
ビギナー
1,875件の閲覧回数

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

Dario_C_
ビギナー
1,875件の閲覧回数

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

Rafael_S_1
ビギナー
1,875件の閲覧回数

humm, ok.

Thanks Dario.

 

 

PaulF_IntelCorp
従業員
1,875件の閲覧回数

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.
 

Iftikar_K_
ビギナー
1,875件の閲覧回数

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

Nik_Ahmad_Z_
ビギナー
1,875件の閲覧回数

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.

返信