apostrophecms / sanitize-html

Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis. Built on htmlparser2 for speed and tolerance
MIT License
3.68k stars 349 forks source link

browser-external:source-map-js:9 Module "source-map-js" has been externalized for browser compatibility. Cannot access "source-map-js.SourceMapConsumer" in client code. See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details #664

Open dhivahar19 opened 4 weeks ago

dhivahar19 commented 4 weeks ago

getting this error when i am using it in clientcode (browser)

boutell commented 4 weeks ago

We use this module only on the server side, and in most cases that is best practice. Front end use cases exist, support for that comes from the community so I've flagged this as "seeking contributions." It is not a bug as the code functions as designed.

de-dan commented 2 weeks ago

The annoying warning originates from the postcss plugin. Here is a suggestion to ship postcss as ESM which would potentially fix it: https://github.com/postcss/postcss/issues/1858

Alternatively exchange postcss plugin.