Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass through NODE_ENV to Node-based Inertia SSR server #517

Closed
wants to merge 1 commit into from

Conversation

hjanos1
Copy link

@hjanos1 hjanos1 commented Mar 30, 2023

Got an error like the one below, so I have realized that process.env.NODE_ENV === 'production' checks always detect that the environment is not production on the SSR node server, sometimes leading to debug mode behaviour and skipping of production optimizations.

This PR solves the issue by passing through Laravel's environment to the Node-based Inertia SSR server when starting the server through the inertia:start-ssr command.

Error mentioned:

SerializableStateInvariantMiddleware took 35ms, which is more than the warning threshold of 32ms. If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions. It is disabled in production builds, so you don't need to worry about that.

@jameshulse
Copy link

Seeing as NODE_ENV would usually either be development or production: would it make sense to pass production if the app()->environment is production, or pass development otherwise? That avoids it being set to 'local' for example which wouldn't be a useful value in most cases, but is common in Laravel.

@driesvints driesvints deleted the branch inertiajs:master May 15, 2024 15:01
@driesvints driesvints closed this May 15, 2024
@driesvints
Copy link
Collaborator

Heya. We removed our master branch. Feel free to re-attempt this to 1.x!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants