Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

CamKem's avatar
Level 10

Hot Reload not working with Homestead / Vite / Vue

Hello, I have an issue when running "npm run dev" with my current setup using Homestead & Vite.

I am not getting any hot reload of files when I make changes, so I deleted the build/assets file, and now I get 404 errors when trying to load that page.

I suspect it has something to do with vite setup not interacting with homestead config correctly.

My homestead.yaml file looks like this:

---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Sites/learnblog
      to: /home/vagrant/code/learnblog
    - map: ~/Sites/evo
      to: /home/vagrant/code/evo
    - map: ~/Sites/Social-Stream
      to: /home/vagrant/code/social-stream

sites:
    - map: social-stream.x
      to: /home/vagrant/code/social-stream/public
    - map: evo.x
      to: /home/vagrant/code/evo/public
    - map: learnblog.x
      to: /home/vagrant/code/learnblog/public

databases:
    - social-stream
    - learnblog
    - evo

features:
    - mysql: true
    - mariadb: false
    - postgresql: false
    - ohmyzsh: false
    - webdriver: false

services:
    - enabled:
    - "mysql"

ports:
    - send: 33060 # MySQL/MariaDB
      to: 3306
    - send: 8025 # Mailhog
      to: 8025

My vite config looks like this:

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
    plugins: [
        laravel({
            input: 'resources/js/app.js',
            refresh: true,
        }),
        vue({
            template: {
                transformAssetUrls: {
                    base: null,
                    includeAbsolute: false,
                },
            },
        }),
    ],
    server: {
        https: true,
        host: '192.168.10.10'
    },
});

The data that comes up when I run "npm run dev" is as follows

VITE v4.0.4  ready in 3450 ms

  ➜  Local:   https://192.168.10.10:5173/
  ➜  Network: https://10.0.2.15:5173/
  ➜  Network: https://192.168.10.10:5173/
  ➜  press h to show help

  LARAVEL v9.47.0  plugin v0.7.3

  ➜  APP_URL: http://evo.x
node:internal/errors:491
    ErrorCaptureStackTrace(err);
    ^

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/vagrant/code/evo/vendor/laravel/framework/src/Illuminate/Auth/Events/Logout.php'
    at FSWatcher.<computed> (node:internal/fs/watchers:244:19)
    at Object.watch (node:fs:2315:34)
    at createFsWatchInstance (file:///home/vagrant/code/evo/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:48596:17)
    at setFsWatchListener (file:///home/vagrant/code/evo/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:48643:15)
    at NodeFsHandler._watchWithNodeFs (file:///home/vagrant/code/evo/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:48798:14)
    at NodeFsHandler._handleFile (file:///home/vagrant/code/evo/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:48862:23)
    at NodeFsHandler._addToNodeFs (file:///home/vagrant/code/evo/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:49104:21)
Emitted 'error' event on FSWatcher instance at:
    at FSWatcher._handleError (file:///home/vagrant/code/evo/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:50296:10)
    at NodeFsHandler._addToNodeFs (file:///home/vagrant/code/evo/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:49112:18) {
  errno: -28,
  syscall: 'watch',
  code: 'ENOSPC',
  path: '/home/vagrant/code/evo/vendor/laravel/framework/src/Illuminate/Auth/Events/Logout.php',
  filename: '/home/vagrant/code/evo/vendor/laravel/framework/src/Illuminate/Auth/Events/Logout.php'
}

Node.js v18.13.0
fatal error: all goroutines are asleep - deadlock!

goroutine 1 [chan receive]:
github.com/evanw/esbuild/internal/helpers.(*ThreadSafeWaitGroup).Wait(...)
        github.com/evanw/esbuild/internal/helpers/waitgroup.go:36
main.runService.func2()
        github.com/evanw/esbuild/cmd/esbuild/service.go:127 +0x59
main.runService(0x1)
        github.com/evanw/esbuild/cmd/esbuild/service.go:181 +0x530
main.main()
        github.com/evanw/esbuild/cmd/esbuild/main.go:230 +0x21c

goroutine 6 [chan receive]:
main.runService.func1()
        github.com/evanw/esbuild/cmd/esbuild/service.go:111 +0x3e
created by main.runService
        github.com/evanw/esbuild/cmd/esbuild/service.go:109 +0x1e5

goroutine 7 [chan receive]:
main.(*serviceType).sendRequest(0xc000023dd0, {0x8c09c0, 0xc00059e030})
        github.com/evanw/esbuild/cmd/esbuild/service.go:210 +0x110
main.runService.func3()
        github.com/evanw/esbuild/cmd/esbuild/service.go:138 +0x39
created by main.runService
        github.com/evanw/esbuild/cmd/esbuild/service.go:135 +0x354

goroutine 38 [chan receive]:
github.com/evanw/esbuild/internal/bundler.(*scanner).scanAllDependencies(0xc000276400)
        github.com/evanw/esbuild/internal/bundler/bundler.go:1783 +0x218
github.com/evanw/esbuild/internal/bundler.ScanBundle({_, _, _, _, _, _}, {_, _}, _, {0xc8b258, ...}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:1200 +0x81f
github.com/evanw/esbuild/pkg/api.rebuildImpl({0xc0000768a0, {0x0, 0x0, 0x0}, {0x0, 0x1, 0x2, 0x5, 0xc00011fe00}, {0xc8b258, ...}, ...}, ...)
        github.com/evanw/esbuild/pkg/api/api_impl.go:1184 +0x245
github.com/evanw/esbuild/pkg/api.buildImpl({0x2, 0x5, 0x0, 0xc00011f950, 0x0, {0x0, 0x0}, 0x0, 0x0, {0x0, ...}, ...})
        github.com/evanw/esbuild/pkg/api/api_impl.go:888 +0x877
github.com/evanw/esbuild/pkg/api.Build(...)
        github.com/evanw/esbuild/pkg/api/api.go:375
main.(*serviceType).handleBuildRequest(0xc000023dd0, 0x1?, 0xc00011f590?)
        github.com/evanw/esbuild/cmd/esbuild/service.go:507 +0x965
main.(*serviceType).handleIncomingPacket(0x40de85?, {0xc000144c00?, 0xc0002497a0?, 0xc00004efd0?})
        github.com/evanw/esbuild/cmd/esbuild/service.go:239 +0x191
main.runService.func4()
        github.com/evanw/esbuild/cmd/esbuild/service.go:169 +0x32
created by main.runService
        github.com/evanw/esbuild/cmd/esbuild/service.go:168 +0x546

goroutine 540 [chan receive]:
main.(*serviceType).sendRequest(0xc000023dd0, {0x8c09c0, 0xc00059f200})
        github.com/evanw/esbuild/cmd/esbuild/service.go:210 +0x110
main.(*serviceType).convertPlugins.func2.4({{0xc00019bc80, 0x39}, {0xc00012fcb0, 0x4}, {0x0, 0x0}, {0x0, 0x0}})
        github.com/evanw/esbuild/cmd/esbuild/service.go:885 +0x4a6
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onLoad.func1({{0x0, 0x0}, {{0xc00019bc80, 0x39}, {0xc00012fcb0, 0x4}, {0x0, 0x0}, 0x0}})
        github.com/evanw/esbuild/pkg/api/api_impl.go:1666 +0x19d
github.com/evanw/esbuild/internal/bundler.runOnLoadPlugins({0xc000076900?, 0x1, 0x0?}, 0x52?, {0xa0e158, 0xc0000754c0?}, 0x0?, {0xc00017b2d0, 0xc000011908, 0xc000011920, ...}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:910 +0xe4a
github.com/evanw/esbuild/internal/bundler.parseFile({{0xa0e158, 0xc0000754c0}, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, 0xc000276800, 0xc0000768a0, ...})
        github.com/evanw/esbuild/internal/bundler/bundler.go:135 +0x227
created by github.com/evanw/esbuild/internal/bundler.(*scanner).maybeParseFile
        github.com/evanw/esbuild/internal/bundler/bundler.go:1331 +0xb57

goroutine 556 [chan receive]:
main.(*serviceType).sendRequest(0xc000023dd0, {0x8c09c0, 0xc00059f110})
        github.com/evanw/esbuild/cmd/esbuild/service.go:210 +0x110
main.(*serviceType).convertPlugins.func2.4({{0xc0004efe00, 0x44}, {0xc000308780, 0x4}, {0x0, 0x0}, {0x0, 0x0}})
        github.com/evanw/esbuild/cmd/esbuild/service.go:885 +0x4a6
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onLoad.func1({{0x0, 0x0}, {{0xc0004efe00, 0x44}, {0xc000308780, 0x4}, {0x0, 0x0}, 0x0}})
        github.com/evanw/esbuild/pkg/api/api_impl.go:1666 +0x19d
github.com/evanw/esbuild/internal/bundler.runOnLoadPlugins({0xc000076900?, 0x1, 0x0?}, 0x6b8439?, {0xa0e158, 0xc0000754c0?}, 0x4?, {0xc00017b2d0, 0xc000011908, 0xc000011920, ...}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:910 +0xe4a
github.com/evanw/esbuild/internal/bundler.parseFile({{0xa0e158, 0xc0000754c0}, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, 0xc000276800, 0xc0000768a0, ...})
        github.com/evanw/esbuild/internal/bundler/bundler.go:135 +0x227
created by github.com/evanw/esbuild/internal/bundler.(*scanner).maybeParseFile
        github.com/evanw/esbuild/internal/bundler/bundler.go:1331 +0xb57

goroutine 553 [chan receive]:
main.(*serviceType).sendRequest(0xc000023dd0, {0x8c09c0, 0xc00059f140})
        github.com/evanw/esbuild/cmd/esbuild/service.go:210 +0x110
main.(*serviceType).convertPlugins.func2.4({{0xc000582300, 0x3b}, {0xc000352050, 0x4}, {0x0, 0x0}, {0x0, 0x0}})
        github.com/evanw/esbuild/cmd/esbuild/service.go:885 +0x4a6
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onLoad.func1({{0x0, 0x0}, {{0xc000582300, 0x3b}, {0xc000352050, 0x4}, {0x0, 0x0}, 0x0}})
        github.com/evanw/esbuild/pkg/api/api_impl.go:1666 +0x19d
github.com/evanw/esbuild/internal/bundler.runOnLoadPlugins({0xc000076900?, 0x1, 0xc000308660?}, 0x7f9a65a6b688?, {0xa0e158, 0xc0000754c0?}, 0x20?, {0xc00017b2d0, 0xc000011908, 0xc000011920, ...}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:910 +0xe4a
github.com/evanw/esbuild/internal/bundler.parseFile({{0xa0e158, 0xc0000754c0}, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, 0xc000276800, 0xc0000768a0, ...})
        github.com/evanw/esbuild/internal/bundler/bundler.go:135 +0x227
created by github.com/evanw/esbuild/internal/bundler.(*scanner).maybeParseFile
        github.com/evanw/esbuild/internal/bundler/bundler.go:1331 +0xb57

goroutine 554 [chan receive]:
main.(*serviceType).sendRequest(0xc000023dd0, {0x8c09c0, 0xc00059f170})
        github.com/evanw/esbuild/cmd/esbuild/service.go:210 +0x110
main.(*serviceType).convertPlugins.func2.4({{0xc00026e300, 0x3f}, {0xc0002892f0, 0x4}, {0x0, 0x0}, {0x0, 0x0}})
        github.com/evanw/esbuild/cmd/esbuild/service.go:885 +0x4a6
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onLoad.func1({{0x0, 0x0}, {{0xc00026e300, 0x3f}, {0xc0002892f0, 0x4}, {0x0, 0x0}, 0x0}})
        github.com/evanw/esbuild/pkg/api/api_impl.go:1666 +0x19d
github.com/evanw/esbuild/internal/bundler.runOnLoadPlugins({0xc000076900?, 0x1, 0x0?}, 0x50?, {0xa0e158, 0xc0000754c0?}, 0x0?, {0xc00017b2d0, 0xc000011908, 0xc000011920, ...}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:910 +0xe4a
github.com/evanw/esbuild/internal/bundler.parseFile({{0xa0e158, 0xc0000754c0}, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, 0xc000276800, 0xc0000768a0, ...})
        github.com/evanw/esbuild/internal/bundler/bundler.go:135 +0x227
created by github.com/evanw/esbuild/internal/bundler.(*scanner).maybeParseFile
        github.com/evanw/esbuild/internal/bundler/bundler.go:1331 +0xb57

goroutine 555 [chan receive]:
main.(*serviceType).sendRequest(0xc000023dd0, {0x8c09c0, 0xc00059f1a0})
        github.com/evanw/esbuild/cmd/esbuild/service.go:210 +0x110
main.(*serviceType).convertPlugins.func2.4({{0xc00026e580, 0x3a}, {0xc0003086e0, 0x4}, {0x0, 0x0}, {0x0, 0x0}})
        github.com/evanw/esbuild/cmd/esbuild/service.go:885 +0x4a6
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onLoad.func1({{0x0, 0x0}, {{0xc00026e580, 0x3a}, {0xc0003086e0, 0x4}, {0x0, 0x0}, 0x0}})
        github.com/evanw/esbuild/pkg/api/api_impl.go:1666 +0x19d
github.com/evanw/esbuild/internal/bundler.runOnLoadPlugins({0xc000076900?, 0x1, 0x0?}, 0x64?, {0xa0e158, 0xc0000754c0?}, 0x0?, {0xc00017b2d0, 0xc000011908, 0xc000011920, ...}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:910 +0xe4a
github.com/evanw/esbuild/internal/bundler.parseFile({{0xa0e158, 0xc0000754c0}, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, 0xc000276800, 0xc0000768a0, ...})
        github.com/evanw/esbuild/internal/bundler/bundler.go:135 +0x227
created by github.com/evanw/esbuild/internal/bundler.(*scanner).maybeParseFile
        github.com/evanw/esbuild/internal/bundler/bundler.go:1331 +0xb57

goroutine 192 [chan receive]:
main.(*serviceType).sendRequest(0xc000023dd0, {0x8c09c0, 0xc00059f0e0})
        github.com/evanw/esbuild/cmd/esbuild/service.go:210 +0x110
main.(*serviceType).convertPlugins.func2.3({{0xc000026d00, 0x1a}, {0xc00019c730, 0x4f}, {0xc0003f1598, 0x6}, {0x0, 0x0}, 0x2, {0x8a9e00, ...}})
        github.com/evanw/esbuild/cmd/esbuild/service.go:800 +0x5f4
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onResolve.func1({{0xc000026d00, 0x1a}, {0x0, 0x0}, {0x8a9e00, 0xc22af8}, {{0xc00019c730, 0x4f}, {0xc0003f1598, 0x6}, ...}, ...})
        github.com/evanw/esbuild/pkg/api/api_impl.go:1611 +0x215
github.com/evanw/esbuild/internal/bundler.RunOnResolvePlugins({_, _, _}, _, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:793 +0x8d5
github.com/evanw/esbuild/internal/bundler.parseFile({{0xa0e158, 0xc0000754c0}, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, 0xc000276800, 0xc0000768a0, ...})
        github.com/evanw/esbuild/internal/bundler/bundler.go:393 +0x30dc
created by github.com/evanw/esbuild/internal/bundler.(*scanner).maybeParseFile
        github.com/evanw/esbuild/internal/bundler/bundler.go:1331 +0xb57

goroutine 539 [chan receive]:
main.(*serviceType).sendRequest(0xc000023dd0, {0x8c09c0, 0xc00059f1d0})
        github.com/evanw/esbuild/cmd/esbuild/service.go:210 +0x110
main.(*serviceType).convertPlugins.func2.4({{0xc0004ef680, 0x42}, {0xc000158d80, 0x4}, {0x0, 0x0}, {0x0, 0x0}})
        github.com/evanw/esbuild/cmd/esbuild/service.go:885 +0x4a6
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onLoad.func1({{0x0, 0x0}, {{0xc0004ef680, 0x42}, {0xc000158d80, 0x4}, {0x0, 0x0}, 0x0}})
        github.com/evanw/esbuild/pkg/api/api_impl.go:1666 +0x19d
github.com/evanw/esbuild/internal/bundler.runOnLoadPlugins({0xc000076900?, 0x1, 0x0?}, 0x5d?, {0xa0e158, 0xc0000754c0?}, 0x0?, {0xc00017b2d0, 0xc000011908, 0xc000011920, ...}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:910 +0xe4a
github.com/evanw/esbuild/internal/bundler.parseFile({{0xa0e158, 0xc0000754c0}, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, 0xc000276800, 0xc0000768a0, ...})
        github.com/evanw/esbuild/internal/bundler/bundler.go:135 +0x227
created by github.com/evanw/esbuild/internal/bundler.(*scanner).maybeParseFile
        github.com/evanw/esbuild/internal/bundler/bundler.go:1331 +0xb57

goroutine 187 [chan receive]:
main.(*serviceType).sendRequest(0xc000023dd0, {0x8c09c0, 0xc00059f020})
        github.com/evanw/esbuild/cmd/esbuild/service.go:210 +0x110
main.(*serviceType).convertPlugins.func2.3({{0xc000198cc0, 0x1a}, {0xc00046a900, 0x53}, {0xc0003f1520, 0x6}, {0x0, 0x0}, 0x2, {0x8a9e00, ...}})
        github.com/evanw/esbuild/cmd/esbuild/service.go:800 +0x5f4
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onResolve.func1({{0xc000198cc0, 0x1a}, {0x0, 0x0}, {0x8a9e00, 0xc22b90}, {{0xc00046a900, 0x53}, {0xc0003f1520, 0x6}, ...}, ...})
        github.com/evanw/esbuild/pkg/api/api_impl.go:1611 +0x215
github.com/evanw/esbuild/internal/bundler.RunOnResolvePlugins({_, _, _}, _, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:793 +0x8d5
github.com/evanw/esbuild/internal/bundler.parseFile({{0xa0e158, 0xc0000754c0}, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, 0xc000276800, 0xc0000768a0, ...})
        github.com/evanw/esbuild/internal/bundler/bundler.go:393 +0x30dc
created by github.com/evanw/esbuild/internal/bundler.(*scanner).maybeParseFile
        github.com/evanw/esbuild/internal/bundler/bundler.go:1331 +0xb57

goroutine 532 [chan receive]:
main.(*serviceType).sendRequest(0xc000023dd0, {0x8c09c0, 0xc00059efc0})
        github.com/evanw/esbuild/cmd/esbuild/service.go:210 +0x110
main.(*serviceType).convertPlugins.func2.3({{0xc0002d6490, 0x3}, {0xc0004efc70, 0x48}, {0xc0003083d0, 0x6}, {0x0, 0x0}, 0x2, {0x8a9e00, ...}})
        github.com/evanw/esbuild/cmd/esbuild/service.go:800 +0x5f4
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onResolve.func1({{0xc0002d6490, 0x3}, {0x0, 0x0}, {0x8a9e00, 0xc22c50}, {{0xc0004efc70, 0x48}, {0xc0003083d0, 0x6}, ...}, ...})
        github.com/evanw/esbuild/pkg/api/api_impl.go:1611 +0x215
github.com/evanw/esbuild/internal/bundler.RunOnResolvePlugins({_, _, _}, _, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:793 +0x8d5
github.com/evanw/esbuild/internal/bundler.parseFile({{0xa0e158, 0xc0000754c0}, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, 0xc000276800, 0xc0000768a0, ...})
        github.com/evanw/esbuild/internal/bundler/bundler.go:393 +0x30dc
created by github.com/evanw/esbuild/internal/bundler.(*scanner).maybeParseFile
        github.com/evanw/esbuild/internal/bundler/bundler.go:1331 +0xb57

goroutine 464 [chan receive]:
main.(*serviceType).sendRequest(0xc000023dd0, {0x8c09c0, 0xc0006647e0})
        github.com/evanw/esbuild/cmd/esbuild/service.go:210 +0x110
main.(*serviceType).convertPlugins.func2.3({{0xc00019bec0, 0x2d}, {0xc0004ef810, 0x48}, {0xc000159d18, 0x6}, {0x0, 0x0}, 0x2, {0x8a9e00, ...}})
        github.com/evanw/esbuild/cmd/esbuild/service.go:800 +0x5f4
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onResolve.func1({{0xc00019bec0, 0x2d}, {0x0, 0x0}, {0x8a9e00, 0xc22c30}, {{0xc0004ef810, 0x48}, {0xc000159d18, 0x6}, ...}, ...})
        github.com/evanw/esbuild/pkg/api/api_impl.go:1611 +0x215
github.com/evanw/esbuild/internal/bundler.RunOnResolvePlugins({_, _, _}, _, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:793 +0x8d5
github.com/evanw/esbuild/internal/bundler.parseFile({{0xa0e158, 0xc0000754c0}, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, 0xc000276800, 0xc0000768a0, ...})
        github.com/evanw/esbuild/internal/bundler/bundler.go:393 +0x30dc
created by github.com/evanw/esbuild/internal/bundler.(*scanner).maybeParseFile
        github.com/evanw/esbuild/internal/bundler/bundler.go:1331 +0xb57

goroutine 515 [chan receive]:
main.(*serviceType).sendRequest(0xc000023dd0, {0x8c09c0, 0xc000443830})
        github.com/evanw/esbuild/cmd/esbuild/service.go:210 +0x110
main.(*serviceType).convertPlugins.func2.3({{0xc000582440, 0x30}, {0xc0004efb80, 0x44}, {0xc000289150, 0x6}, {0x0, 0x0}, 0x2, {0x8a9e00, ...}})
        github.com/evanw/esbuild/cmd/esbuild/service.go:800 +0x5f4
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onResolve.func1({{0xc000582440, 0x30}, {0x0, 0x0}, {0x8a9e00, 0xc22c38}, {{0xc0004efb80, 0x44}, {0xc000289150, 0x6}, ...}, ...})
        github.com/evanw/esbuild/pkg/api/api_impl.go:1611 +0x215
github.com/evanw/esbuild/internal/bundler.RunOnResolvePlugins({_, _, _}, _, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, ...)
        github.com/evanw/esbuild/internal/bundler/bundler.go:793 +0x8d5
github.com/evanw/esbuild/internal/bundler.parseFile({{0xa0e158, 0xc0000754c0}, {0xc00017b2d0, 0xc000011908, 0xc000011920, 0xc000075460, 0x5, 0xc00011fe00}, 0xc000276800, 0xc0000768a0, ...})
        github.com/evanw/esbuild/internal/bundler/bundler.go:393 +0x30dc
created by github.com/evanw/esbuild/internal/bundler.(*scanner).maybeParseFile
        github.com/evanw/esbuild/internal/bundler/bundler.go:1331 +0xb57
vagrant@homestead:~/code/evo$ 

I have no idea what all those errors are for file limits, but I don't think they necessarily are the issue, I think it has something to do with the ports that vite is assigning to the url on the server.

1 - is there as way to control the ports set with the vite server so that it redirects to the correct port when using the IP address?

2 - how do I find out or set in my homestead.yaml file which port is used by each of the sites that are set up in the file.

0 likes
2 replies
CamKem's avatar
CamKem
OP
Best Answer
Level 10

Turns out homestead won't work correctly with Vite.

For those wanting to use custom urls & ssh, for say auth0 / socialite testing on local dev environment. I suggest using sail & checking out this article (https://freek.dev/2276-making-vite-and-valet-play-nice-together) as it won't work out of the box, there is extra lines of config needing added to your vite.config.js. Something like the following:

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
    plugins: [
        laravel({
            input: 'resources/js/app.js',
            refresh: true,
            valetTls: 'domain.test',
        }),
        vue({
            template: {
                transformAssetUrls: {
                    base: null,
                    includeAbsolute: false,
                },
            },
        }),
    ],
    server: {
        https: true,
        host: 'domain.test',
    },
});

Please or to participate in this conversation.