generated from kemboi22/laravel-inertia-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiagnose-vite.php
More file actions
53 lines (42 loc) · 1.38 KB
/
diagnose-vite.php
File metadata and controls
53 lines (42 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
echo "=== Vite Development Server Diagnostic ===\n\n";
// Check if we're in development mode
$isDev = env('APP_ENV') === 'local';
echo 'Development mode: '.($isDev ? 'YES' : 'NO')."\n";
// Check Vite dev server URL
$viteUrl = env('VITE_DEV_SERVER_URL', 'http://localhost:5100');
echo "Vite dev server URL: $viteUrl\n";
// Test connection to Vite server
echo "\nTesting connection to Vite server...\n";
$context = stream_context_create([
'http' => [
'timeout' => 5,
'method' => 'GET',
],
]);
$result = @file_get_contents($viteUrl, false, $context);
if ($result !== false) {
echo "✅ Successfully connected to Vite server\n";
echo 'Response length: '.strlen($result)." bytes\n";
} else {
echo "❌ Failed to connect to Vite server\n";
$error = error_get_last();
if ($error) {
echo 'Error: '.$error['message']."\n";
}
}
// Check if hot file exists
$hotFile = public_path('hot');
echo "\nHot file status:\n";
echo "Path: $hotFile\n";
echo 'Exists: '.(file_exists($hotFile) ? 'YES' : 'NO')."\n";
if (file_exists($hotFile)) {
$hotContent = file_get_contents($hotFile);
echo "Content: $hotContent\n";
}
// Check manifest file
$manifestFile = public_path('build/manifest.json');
echo "\nManifest file status:\n";
echo "Path: $manifestFile\n";
echo 'Exists: '.(file_exists($manifestFile) ? 'YES' : 'NO')."\n";
echo "\n=== End Diagnostic ===\n";