-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Bug: Cannot destructure property 'existsSync' of 'require_empty(...) #95
Comments
Hello any updates ? |
I am having the same issue. Has anyone found a solution? |
The issue arises because polyfills substitute Node.js's fs module with a mock fs that is compatible with the browser but lacks certain methods like existsSync. I faced a similar problem, but since I was working with Electron.js, I resolved it by creating a new fs instance using contextBridge.e
If you’re not using Electron, which appears to be the case, you can try adding the following to your vite.config.js:
|
The override was what I needed. Thank you. |
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:
:
The problem is with the fs and path modules. Here is visible they are used by postcss inside previous.map.js:
The text was updated successfully, but these errors were encountered: