Uncaught ReferenceError: require is not defined
Closed this issue · 1 comments
vietnamesekid commented
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
When running the extension in Chrome, the following error appears in the DevTools console:
Uncaught ReferenceError: require is not definedStack Trace
Custom setup
I am not using the default Supabase client.
Instead, I created a custom Supabase Manager that persists session data using chrome.storage (instead of localStorage / default storage).
This is necessary for Chrome Extensions (Manifest V3) where background scripts and popups cannot rely on window.localStorage.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Build the extension using Vite
- Load the
dist/folder in Chrome viachrome://extensions(Developer Mode → Load unpacked) - Open the extension background page or popup in DevTools
- See error
require is not defined
Expected behavior
The extension should run in the browser context without requiring Node.js built-ins.
vietnamesekid commented
Resolved