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

388
Views
Tinymce cargar la URL de la imagen en reaccionar no funciona

Estoy tratando de insertar la URL de la imagen en mi editor de texto hecho en Reactjs y tineymce. Pero da error como:

Uncaught TypeError: Cannot read properties of undefined (reading 'nodeName')

Este es mi código para el editor.

 export default function DraftEditor() { const editorRef = useRef(null); const example_image_upload_handler = (blobInfo, progress) => new Promise((resolve, reject) => { const xhr = new XMLHttpRequest(); xhr.withCredentials = false; xhr.open( "POST", "image_upload_url", true ); xhr.upload.onprogress = (e) => { progress((e.loaded / e.total) * 100); }; xhr.onload = () => { if (xhr.status === 403) { reject({ message: "HTTP Error: " + xhr.status, remove: true }); return; } if (xhr.status < 200 || xhr.status >= 300) { reject("HTTP Error: " + xhr.status); return; } const json = JSON.parse(xhr.responseText); if (!json || typeof json.data != "string") { reject("Invalid JSON: " + xhr.responseText); return; } resolve(json.data); }; const formData = new FormData(); formData.append("image", blobInfo.blob(), blobInfo.filename()); xhr.send(formData); }); return ( <> <Editor apiKey={process.env.REACT_APP_TINY} onInit={(evt, editor) => (editorRef.current = editor)} initialValue={``} init={{ images_upload_handler: example_image_upload_handler, plugins: [ "image", ], image_title: true, file_picker_types: "image", automatic_uploads: true, content_style: "body { font-family:Helvetica,Arial,sans-serif; font-size:14px }", images_file_types: "jpg,svg,png", toolbar: "codesample code", content_style: "body { font-family: 'Courier New', Courier, monospace; font-size: 0.9em }", }} /> </> ); }

Este código de carga de imágenes proviene de su documentación. Estoy cargando una imagen local en mi servidor e intentando insertar el enlace devuelto en el editor.

Este es mi error ss. ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
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!