If you’re using Vite.js with react and using the Dynamic SDK you may get this error in your console:
This is because one of the many libraries that our SDK depends on uses the process
module which is natively not in the browser environment nor is it automatically polyfilled by Vite.
process
using vite.config.js
To fix this we must modify the vite.config.js
file to modify esbuild
to polyfill this for us. Here is a minimal example config:
React Static Flag Error
After applying the polyfill, you may still see an error for React Static Flag Error
. This is currently expected. To learn more, checkout the troubleshooting page React Static Flag Error. At this time, you can ignore this error in local development environment.
If you’re using Vite.js with react and using the Dynamic SDK you may get this error in your console:
This is because one of the many libraries that our SDK depends on uses the process
module which is natively not in the browser environment nor is it automatically polyfilled by Vite.
process
using vite.config.js
To fix this we must modify the vite.config.js
file to modify esbuild
to polyfill this for us. Here is a minimal example config:
React Static Flag Error
After applying the polyfill, you may still see an error for React Static Flag Error
. This is currently expected. To learn more, checkout the troubleshooting page React Static Flag Error. At this time, you can ignore this error in local development environment.