1

I can't run all my cordova projects in browser platform. Please help me.

$ cordova platform rm browser
Removing browser from cordova.platforms array in package.json
$ cordova platform add browser
Using cordova-fetch for cordova-browser@^6.0.0
Adding browser project...
$ cordova run browser
Updating manifest.json with push properties…
url.URL is not a constructor

THNKS

3
  • 1
    can you please check that "stackoverflow.com/questions/44738065/…"
    – Bassam
    Commented Jul 26, 2019 at 10:45
  • Use the search engine, or Google at least, for the next question..
    – andreszs
    Commented Jul 28, 2019 at 15:52
  • Sorry but this solution doesn't fix the problem
    – Dave Lin
    Commented Jul 31, 2019 at 7:49

1 Answer 1

4

Found a solution: edit file platforms/browser/cordova/lib/run.js

Comment line 57:

// var projectUrl = (new url.URL(`http://localhost:${server.port}/${startPage}`)).href;

And replace it with new line:

var projectUrl = `http://localhost:${server.port}/${startPage}`;

Works for me!

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.