react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

ypeError: null is not an object (evaluatingr.canvasContext.canvas"

Open xiaoyangerbiepao opened this issue 2 years ago β€’ 1 comments

class RenderPdf extends PureComponent { state = { numPages: null, pageNumber: 1, numList: [1], errorMessage: '' } onDocumentLoadSuccess = ({ numPages }) => { let numList = [] for (let i = 1; i <= numPages; i++) { numList.push(i) } this.setState({ numPages, numList }, () => { Toast.hide() } ) }

closePdf = () => { const { dispatch, oldrenderType } = this.props dispatch({ type: 'goodsSafter/changeState', payload: { renderType: oldrenderType, }, }) }

onDocumentLoadError = (e) => { console.error('onDocumentLoadError', e); this.setState({ errorMessage: e }) };

render() { const { pdfUrl } = this.props const { pageNumber, numList, errorMessage } = this.state return ( <div className={style.histort_positions}> {errorMessage} <div className={style.pdf_positions}> <Document file={pdfUrl} onLoadSuccess={this.onDocumentLoadSuccess} onLoadError={this.onDocumentLoadError} page = {1} > { numList.map(it => <Page pageNumber={it} key={it}/>) } </Document>

    <div className={style.close_x} onClick={this.closePdf}>θΏ”ε›ž</div>
  </div>
)

} } 会ζŠ₯ι”™ TypeError: null is not an object (evaluating 'r.canvasContext.canvas')\n\t/g-54/js/app.58d847f5d64f04ed148b.js?ca26d188affc1686d20f:1:133123\nt@https://fqs-sit.csxqyg.com.cn/g-54/js/app.58d847f5d64f04ed148b.js:1:133123 value@https://fqs-sit.csxqyg.com.cn/g-54/js/app.58d847f5d64f04ed148b.js:1:108815 @https://fqs-sit.csxqyg.com.cn/g-54/js/app.58d847f5d64f04ed148b.js:1:1403776 value@https://fqs-sit.csxqyg.com.cn/g-54/js/app.58d847f5d64f04ed148b.js:1:1403943 uc@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1236552 ws@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1256580 c@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1279536 dispatchEvent@[native code] cd@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1280508 a@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1113269 bs@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1255295 bs@[native code] O@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1108973 ys@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1254193 Vc@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1250439 Hc@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1250392 Hc@[native code] @https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1169230 O@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1108973 Ra@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1169177 Da@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1169112 Dc@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1246802 enqueueSetState@https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:1338583 @https://fqs-sit.csxqyg.com.cn/g-54/js/bundle.dll.js:1:983219 @https://fqs-sit.csxqyg.com.cn/g-54/js/app.58d847f5d64f04ed148b.js:1:1415266 n@https://fqs-sit.csxqyg.com.cn/g-54/js/app.58d847f5d64f04ed148b.js:1:1446173 @https://fqs-sit.csxqyg.com.cn/g-54/js/app.58d847f5d64f04ed148b.js:1:1447250 c@https://fqs-sit.csxqyg.com.cn/g-54/js/app.58d847f5d64f04ed148b.js:1:1377837 i@https://fqs-sit.csxqyg.com.cn/g-54/js/app.58d847f5d64f04ed148b.js:1:1378021

xiaoyangerbiepao avatar Sep 19 '23 03:09 xiaoyangerbiepao

Please provide a way to reproduce it that's correctly styled and explained

diegomura avatar Feb 03 '24 18:02 diegomura