Open p1l3 opened 1 year ago
Error loading content from the uploaded file. Detail is that the content of the file is read in the frontend, below the source code and screenshot of the error
Source code example:
import { useState } from "react"; import SwaggerUI from "swagger-ui-react"; import "swagger-ui-react/swagger-ui.css"; function App() { const [file, setFile] = useState(); const handleChange = (e) => { const fileReader = new FileReader(); fileReader.readAsText(e.target.files[0], "UTF-8"); fileReader.onload = (e) => { setFile(e.target.result); }; }; return ( <div> <h2>Error Swagger Console</h2> <input type="file" onChange={handleChange} /> {file && <SwaggerUI spec={file} />} </div> ); } export default App;
Duplicate of #8273 - please see my comment on that issue for a potential workaround.
Error loading content from the uploaded file. Detail is that the content of the file is read in the frontend, below the source code and screenshot of the error
Q&A (please complete the following information)
Screenshots
Content & configuration
Source code example: