Super slow _server function
My server functions are taking 22 seconds + when I'm running my app in production.
10 Replies
Well this is certainly weird. I'm not too sure why it would work this way...
But the following code makes the whole server take FOREVER to run. This code is being imported from an external library.
This is what I'm doing within the actual app:
This works perfectly fine in dev btw.
Yeah... I'm stuck on this one... I've moved things around, tried changing things here and there and still can't figure this one out.
Not sure why, but the issue has nothing to do with the above code...
You see I have a middleware that needs to use the
process.env
and when I build and start the server locally with the added prefixed env's causes the server functions to be significantly slower.
I don't know why this would slow it down, anyone have any ideas?Where do you host this and how did you configure app.config?
And in production you mean deployed to a server or service or also the production build on localhost?
Hey @Madaxen86 , I'm just now seeing this, this was just running on a NodeJs server locally. But it was running the fully built app.
Did you verify that in production built that the env variables are available?
I think I stumbled over something that envs were available in DEV but not in PROD and I had to install dotenv.
Yeah, I have code that throws an error if it doesn't exist, I also console logged the value before attempting to use it and it was logged.
Did you try to remove the solidifront stuff and test again?
I haven't, but I haven't had problems with it previously. As in the package it used to use
import.meta.env
for all of the environment variables. But realized that there are some that needed to remain private and not exposed to the client. Hence I use process.env for private variables.
I can't see why accessing process.env
from a middleware function would break server functions.GitHub
solidifront/packages/start/src/config/plugins/solidifrontMiddleware...
A Hydrogen like app, but for the "Solid Start" meta framework. - KookiKodes/solidifront
GitHub
solidifront/packages/start/src/middleware/index.ts at main · KookiK...
A Hydrogen like app, but for the "Solid Start" meta framework. - KookiKodes/solidifront
Tough to say. Maybe you can debug line by line to narrow down what exactly takes that long.
I remember that last week somebody also had an issue and I think it was due to some code in his server entry file. Unfortunately I can’t find the post.