You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing an issue with logging in my React client-side rendered app that uses Vite. The application fails to load and throws the following error:
Uncaught ReferenceError: process is not defined
This error occurs in the platform.ts file where Axiom is checking an environment variable using process.env.
Packages I'm using:
"@axiomhq/js": "^1.3.1"
"@axiomhq/logging": "^0.1.4"
"@axiomhq/react": "^0.1.4"
Context
There is an open issue with Vite related to this problem here.
Temporary Solution
The only workaround that currently works in development is to add the following to the Vite configuration:
define: {"process.env": process.env,},
While this solution is functional in development, it does not address the underlying problem.
Steps to Reproduce
Set up a React app using Vite.
Attempt to utilize Axiom for logging.
Observe the error when loading the application.
Expected Behavior
The app should load without errors related to process.env.
Any insights or fixes would be greatly appreciated!