-1

I am trying to use LESS 1.1.3 on localhost and it's not working. Below is my error.

less-1.1.3.min.js:28 XMLHttpRequest cannot load file:///C:/xampp/htdocs/rasarouting/site/templates/styles/fixed2.less. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

Uncaught DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///C:/xampp/htdocs/rasarouting/site/templates/styles/fixed2.less'. at r (file:///C:/xampp/htdocs/rasarouting/site/templates/javascript/less-1.1.3.min.js:28:2626) at o (file:///C:/xampp/htdocs/rasarouting/site/templates/javascript/less-1.1.3.min.js:28:3825) at n (file:///C:/xampp/htdocs/rasarouting/site/templates/javascript/less-1.1.3.min.js:28:4368) at Object.d.refresh (file:///C:/xampp/htdocs/rasarouting/site/templates/javascript/less-1.1.3.min.js:29:1545) at file:///C:/xampp/htdocs/rasarouting/site/templates/javascript/less-1.1.3.min.js:29:1830 at file:///C:/xampp/htdocs/rasarouting/site/templates/javascript/less-1.1.3.min.js:29:1862

What is going on? It works online, why not on localhost?

desbest
  • 4,746
  • 11
  • 51
  • 84

1 Answers1

1

Basically you're not allowed to use the file:// protocol. This is for security. It appears you have XAMPP installed, you should be able to access these files by sending an http request to localhost:[port]/rasarouting/site/templates/javascript/less-1.1.3.min.js

Kyle Becker
  • 1,360
  • 12
  • 20
  • Your answer gives me an `net::ERR_UNKNOWN_URL_SCHEME` error even though I entered the correct address for the javascript. – desbest Apr 28 '17 at 18:12
  • 1
    @desbest what url are you sending the request to? you are going to need an http:// before that and you will need to replace [port] with the port you are running on. – Kyle Becker Apr 28 '17 at 18:14