'Server side rendering not working in Laravel React project
I am running Laravel 8.0 with React 17.0.2.
I am trying to implement SSR for optimizing the app. For that I am referring this youtube tutorial which is using this package by spatie.
After setting up everything, I am getting the follwoing error
file_put_contents(../storage/app/ssr/9fa7979d88956cb5cc5019e5ee1fe73b.js): Failed to open stream: No such file or directory (View: ../resources/views/index.blade.php)
There is a config file ssr.php where I need to defined node.temp path
'node' => [
'node_path' => env('NODE_PATH', '/usr/local/bin/node'),
'temp_path' => env('SSR_TEMP_PATH', storage_path('app/ssr')),
],
What should be this temp_path as there is no such directory called ssr in my app folder?
Solution 1:[1]
Create a folder inside app/ssr and there should be no space in any folder name of the path to the laravel project. I hope it will work for you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | BabaYaga_Coding |
