Cloudflare Pages and sanitize-html #8660
-
Hello. I'm having problems trying to run sanitize-html on on my Cloudflare Pages. sanitize-html needs to have access to node::process and Cloudflare pages does not provide that. The only way I manages to do this work was by creating a file sanitize.server.jsx and globaThis the process. Is it SAFE to do this? Later i import this function to use on my loaders and actions. If I try to use sanitize-html on Cloudflare Pages without doing this i get the error: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You either mock |
Beta Was this translation helpful? Give feedback.
You either mock
globalThis.process
as you did or you need to find another library that doesn't depend on a Node.js built-in feature likeprocess
.