DiegoMasterGOD
My solidstart app just hangs if I use process.env on any place
I'm having weird problems with my solid start app, like the page loads, no error from the terminal or browser, but it was like the javascript code does not run at all, no logic is executed, for example: I have a login page with two fields, and use @felte/solid for validations and initial values, everything works until I import the following file on any of my files:
import { z } from 'zod';
const schema = z.object({
API_BASE_URL: z.string().url(),
})
const target = process.env
export const environment = schema.parse(target)
console.log(environment)
I can see the log in my console with my env variables, but the app is not working on browser (the initial values for the form are not set for fields, no validation, no submit, etc.), the very moment I replace process.env
with a plain js object like { API_BASE_URL: "http://localhost:3000" }
the app works as expected, what could be the problem?2 replies