Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
No puedo cargar Less CSS en mi sitio web, ¿qué debo hacer?

Entonces, he estado tratando de hacer un sitio web con Menos CSS.
No pude hacerlo funcionar con este HTML.

 <!doctype html>
<html>

<head>
 <title>Site I am working on</title>
 <meta charset="utf-8">
 <link rel="stylesheet/less" type="text/css" href="styles.less" />
 <script src="https://cdn.jsdelivr.net/npm/less" ></script>
</head>

<body>
 <!-- ... -->
</body>

</html>

Estos son los errores que recibo en la consola de Chrome DevTools.

 less:10 Access to XMLHttpRequest at 'file:///C:/Users/stysan/Documents/some-site/styles.less' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https, isolated-app.
doXHR @ less:10
less:10 Failed to load resource: net::ERR_FAILED
doXHR @ less:10
less:10 DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///C:/Users/stysan/Documents/some-site/styles.less'.
 at Ct.doXHR (https://cdn.jsdelivr.net/npm/less:10:136145)
 at https://cdn.jsdelivr.net/npm/less:10:136804
 at new Promise (<anonymous>)
 at Ct.loadFile (https://cdn.jsdelivr.net/npm/less:10:136580)
 at d (https://cdn.jsdelivr.net/npm/less:10:143414)
 at m (https://cdn.jsdelivr.net/npm/less:10:144029)
 at https://cdn.jsdelivr.net/npm/less:10:145098
 at new Promise (<anonymous>)
 at s.refresh (https://cdn.jsdelivr.net/npm/less:10:144871)
 at https://cdn.jsdelivr.net/npm/less:10:146053
less:10 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'href')
 at less:10:145151
 at less:10:143969
DevTools failed to load source map: Could not load content for https://cdn.jsdelivr.net/npm/less.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

¡Por favor ayúdenme, cualquier ayuda sería apreciada!

almost 4 years ago · Santiago Trujillo
1 answers
Answer question

0

La respuesta de @UmairFarooq me ayudó a resolver esto: era bastante tonto.

¿Cómo lo solucioné?
La respuesta es bastante simple.

  1. Cargué menos en tu HTML usando este comando:
    <script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/4.1.3/less.min.js"></script>
  2. Abrí un servidor en vivo usando Python 3.10: si tiene Python instalado con la ruta del sistema, puede abrir un servidor en vivo en su directorio HTML escribiendo este comando en el símbolo del sistema:
    python -m http.server 80
  3. Y, finalmente, lo abrí en mi navegador: localhost
almost 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!