Starting SSR server on port 13714...
Inertia SSR server started.
Retail
TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received undefined
at write_ (node:_http_outgoing:949:11)
at ServerResponse.write (node:_http_outgoing:908:15)
at Server.<anonymous> (file:///var/www/html/node_modules/@inertiajs/core/dist/server.esm.js:1:506) {
code: 'ERR_INVALID_ARG_TYPE'
php middleware
class HandleIneriaRequests extends Middleware
{
protected $rootView = 'module';
public function version(Request $request)
{
return parent::version($request);
}
/**
* Handle an incoming request.
*/
public function share(Request $request): array
{
return [
'site' => 'retail',
'ziggy' => fn () => [
...(new Ziggy())->toArray(),
'location' => $request->url(),
],
];
}
}
Getting a error when using ssr rendering.
ive run php artisan ziggy:generate
php middleware
vite.config.js
ssr.js