0

So we ran into a problem while developing an app for Phonegap. To be more precise, cordova doesn't detect cordova_lib, as it's displayed here:

`var cordova_lib = require('cordova-lib');`

We have no idea why it's happening, because we double checked the directory and all the necessary files are in the right places. Here's the error code:

cordova.js:23 Uncaught ReferenceError: require is not defined
at cordova.js:23

Cordova was manually added to phonegap through node.js' CLI.

I'd like to also add that it's our first time using phonegap.

  • Could it be duplicated https://stackoverflow.com/questions/32335750/cordova-js-causes-reference-error-require-is-not-defined?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa? – goediaz Apr 17 '18 at 09:56
  • 1
    That is sadly not the case. We tried every possible solution in that thread and it did not work. – HerbatnikGER Apr 17 '18 at 10:12
  • Try re-adding platform cordova, like [this](https://stackoverflow.com/questions/48826923/cordova-error-failed-to-fetch-platform-cordova-browser5-0-0/48839690#48839690) example..It happens alot – proofzy Apr 18 '18 at 07:05

0 Answers0