davidmyersdev / vite-plugin-node-polyfills

A Vite plugin to polyfill Node's Core Modules for browser environments.
MIT License
263 stars 17 forks source link

Bug: Cannot destructure property 'existsSync' of 'require_empty(...) #95

Open vitorioMarcapo opened 4 weeks ago

vitorioMarcapo commented 4 weeks ago

Summary

I am getting the following error when I added the plugin sanitize-html.js?v=a55f9d5f:6974 Uncaught TypeError: Cannot destructure property 'existsSync' of 'require_empty(...)' as it is null.

It's coming from the postcss, but from my understanding postcss is a dependency of vite and I am not sure how to deal with this.

My config so far is: Screenshot at Jun 06 12-10-32 :

The problem is with the fs and path modules. Here is visible they are used by postcss inside previous.map.js: Screenshot at Jun 06 12-12-54