OpenQDev / OpenQ-Frontend

Frontend for https://openq.dev
https://openq.dev
16 stars 16 forks source link

.sanitize causing 500 error, hard to reproduce #1732

Closed FlacoJones closed 1 year ago

FlacoJones commented 1 year ago

Whenever i navigate DIRECTLY to a route like this (https://staging.openq.dev/contract/I_kwDOGWnnz85iJO8r/0x7be69bd2ad797b31b35314c9dcbb064365c9ac6c), i get the following 500 error on the FE:

However, if i click there via /hackathons, I'm fine

TypeError: dompurify__WEBPACK_IMPORTED_MODULE_2___default(...).sanitize is not a function
    at GithubHtmlRenderer (/app/.next/server/chunks/2624.js:213:71)
    at Wc (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
    at Zc (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
    at Z (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
    at $c (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
    at bd (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404)
    at Z (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217)
    at $c (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
    at Zc (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:145)
    at Z (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
TypeError: dompurify__WEBPACK_IMPORTED_MODULE_2___default(...).sanitize is not a function
    at GithubHtmlRenderer (/app/.next/server/chunks/2624.js:213:71)
    at Wc (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
    at Zc (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
    at Z (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
    at $c (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
    at bd (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404)
    at Z (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217)
    at $c (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
    at Zc (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:145)
    at Z (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
ArcAnya commented 1 year ago

Great post on what was happening there: https://www.reddit.com/r/nextjs/comments/kty9vi/dompurifysanitize_throws_error_that_sanitize_is/