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/…" Commented Jul 26, 2019 at 10:45
  • Use the search engine, or Google at least, for the next question.. Commented Jul 28, 2019 at 15:52
  • Sorry but this solution doesn't fix the problem 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!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.