sanitize-html: Wrong build 1.18.3? Uncaught TypeError: (0 , _sanitizeHtml2.default) is not a function
Hey guys, just received this when new version has been released.
sanitizeHtml.js?70b5f51:7 Uncaught TypeError: (0 , _sanitizeHtml2.default) is not a function
at sanitize (sanitizeHtml.js?70b5f51:7)
at createSanitizeMarkup (sanitizeHtml.js?70b5f51:12)
at TemplatePainterAboutView (View.js?f4af559:50)
at mountIndeterminateComponent (react-dom.development.js?02e2fdd:8574)
at beginWork (react-dom.development.js?02e2fdd:8978)
at performUnitOfWork (react-dom.development.js?02e2fdd:11814)
at workLoop (react-dom.development.js?02e2fdd:11843)
at HTMLUnknownElement.callCallback (react-dom.development.js?02e2fdd:100)
at Object.invokeGuardedCallbackDev (react-dom.development.js?02e2fdd:138)
at invokeGuardedCallback (react-dom.development.js?02e2fdd:187)
Update: We use import sanitizeHtml from 'sanitize-html'
Update2: Affects FE build
Update3: in package.json until it’s fixed
"sanitize-html": "^1.18.2"
// =>
"sanitize-html": "1.18.2"
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 9
- Comments: 19 (11 by maintainers)
Commits related to this issue
- Pin sanitize-html to 0.18.2 Because 0.18.3 is broken (https://github.com/punkave/sanitize-html/issues/241 / https://github.com/punkave/sanitize-html/issues/242 — committed to matrix-org/matrix-react-sdk by dbkr 6 years ago
- Pin sanitize-html to 0.18.2 Because 0.18.3 is broken (https://github.com/punkave/sanitize-html/issues/241 / https://github.com/punkave/sanitize-html/issues/242 — committed to element-hq/element-web by dbkr 6 years ago
@paztis I put some notes on what I think the misunderstanding was over on the revert PR: https://github.com/punkave/sanitize-html/pull/244 - in summary, the npm
browser
field isn’t intended to point to this browser build which is browserified output rather than a module. I don’t think this is the cause of your error.To anyone reading this, the problem was actually not caused by that commit / the lockfile, the previous release wasn’t tagged right. See https://github.com/punkave/sanitize-html/issues/241#issuecomment-409881724