-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 1.18.3 does not have defaults defined #242
Comments
This is a potential duplicate of #241 |
Thanks, that makes more sense. My guess is the tests never do this. Obviously we'll add one. |
Actually the tests do use the defaults object in exactly this way. Are you using the frontend build? I don't see any issues with this in src/index.js or its tests, i.e. what server side code sees. What I do see is that dist/sanitize-html.js (front end) looks way too short to be valid. But I haven't the slightest why that is happening unfortunately. I wonder if something changed in Don't get me wrong here, if there's a bug in the original src/index.js or in dist/index.js please enlighten me with specifics of how to reproduce it. But I can't find one with the tests that are using the exported defaults property. |
Getting the same issue installing the package via NPM. |
Because 0.18.3 is broken (apostrophecms/sanitize-html#241 / apostrophecms/sanitize-html#242
Because 0.18.3 is broken (apostrophecms/sanitize-html#241 / apostrophecms/sanitize-html#242
This was caused by gitignoring and removing package-lock.json in https://github.com/punkave/sanitize-html/pull/240/files#diff-32607347f8126e6534ebc7ebaec4853d. What is the reason this was done? It seems that without the lockfile, some devDependency was silently updated, which changed the build output. This is exactly what lockfiles are there for to prevent - making the build reproducible and deterministic, so breakages can't suddenly happen without any changes to master. Please keep a lockfile checked in. |
Closes apostrophecms#242 and prevents breakages like it in the future.
Seems this solves the problem. Thank you Felix, I'm closing the issue. |
To anyone reading this, the problem was actually not caused by that commit / the lockfile, the previous release wasn't tagged right. See #241 (comment) |
When working with version 1.18.2 I was able to access
sanitizeHtml.defaults
but with version 1.18.3 I'm getting undefined. If I rollback to the former version, there are no problems with the following line:allowedTags: sanitizeHtml.defaults.allowedTags.concat(['h1', 'h2'])
The text was updated successfully, but these errors were encountered: