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

127
Views
Quiero colocar una etiqueta de script

gatsby.js v4.4.0

Quiero configurar una etiqueta de secuencia de comandos. Sin embargo, me sale un error y no puedo configurarlo.

Por favor, dime cómo instalarlo.

 <script type="module" src="https://unpkg.com/x-frame-bypass"></script> <script src="https://unpkg.com/@ungap/custom-elements-builtin"></script>

El código de error se mostrará en su navegador.

Error en la función customElements.define.extends.load en x-frame-bypass.js: X-Frame-Bypass src no comienza con http(s)://

x-frame-bypass.js: no se pudo generar CodeFrame

html.js

 import React from "react" import PropTypes from "prop-types" export default function HTML(props) { return ( <html {...props.htmlAttributes}> <head> <meta charSet="utf-8" /> <meta httpEquiv="x-ua-compatible" content="ie=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> {props.headComponents} <script type="module" src="https://unpkg.com/x-frame-bypass"></script> <script src="https://unpkg.com/@ungap/custom-elements-builtin"></script> </head> <body {...props.bodyAttributes}> {props.preBodyComponents} <div key={`body`} id="___gatsby" dangerouslySetInnerHTML={{ __html: props.body }} /> {props.postBodyComponents} </body> </html> ) } HTML.propTypes = { htmlAttributes: PropTypes.object, headComponents: PropTypes.array, bodyAttributes: PropTypes.object, preBodyComponents: PropTypes.array, body: PropTypes.string, postBodyComponents: PropTypes.array, } html.js
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

no deberías tener una etiqueta html en reaccionar

De acuerdo, sin embargo, en este caso, está usando la personalización HTML de Gatsby .

El error que se está solicitando:

Error en la función customElements.define.extends.load en x-frame-bypass.js: X-Frame-Bypass src no comienza con http(s)://

x-frame-bypass.js: no se pudo generar CodeFrame

Esto significa que el script se cargó correctamente.

Si echa un vistazo a la URL que está solicitando ( https://unpkg.com/x-frame-bypass@1.0.2/x-frame-bypass.js ), verá customElements.define y la excepción que está siendo arrojado a:

 if (!url || !url.startsWith('http')) throw new Error(`X-Frame-Bypass src ${url} does not start with http(s)://`) console.log('X-Frame-Bypass loading:', URL)

Es probable que se trate de un problema de localhost . Debería desaparecer tan pronto como el sitio se implemente en un dominio personalizado.

Además, según los documentos , el orden de los scripts debe invertirse:

 <script src="https://unpkg.com/@ungap/custom-elements-builtin"></script> <script type="module" src="https://unpkg.com/x-frame-bypass"></script>

El primero (opcional) es:

 <script src="https://unpkg.com/@ungap/custom-elements-builtin"></script>

Una vez hecho esto, solo necesita cargar el iframe con el atributo is="x-frame-bypass" :

 <iframe is="x-frame-bypass" src="https://stackoverflow.com/" height="100%" width-"100%" />
about 4 years ago · Juan Pablo Isaza 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!