Do you have a file named hot in your public directory?
Sep 23, 2022
25
Level 1
failed to load config from vite.config.ts
Hi, I am having trouble in using vite and getting below error while running yarn build command. I could not move forward even after spending hours in this blocker. Any help would be greatly appreciated.
Error:
C:\laragon5\www\probelian>yarn build
yarn run v1.22.19
$ vite build
failed to load config from C:\laragon5\www\probelian\vite.config.ts
error during build:
TypeError: artisan.commands is not iterable
at new ViteConfiguration (C:\laragon5\www\probelian\node_modules\laravel-vite\dist\index.js:238:37)
at defineConfig (C:\laragon5\www\probelian\node_modules\laravel-vite\dist\index.js:352:10)
at Object.<anonymous> (C:\laragon5\www\probelian\vite.config.ts:34:64)
at Module._compile (node:internal/modules/cjs/loader:1120:14)
at require.extensions.<computed> [as .ts] (C:\laragon5\www\probelian\node_modules\vite\dist\node\chunks\dep-689425f3.js:62006:20)
at Module.load (node:internal/modules/cjs/loader:998:32)
at Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1022:19)
at require (node:internal/modules/cjs/helpers:102:18)
at loadConfigFromBundledFile (C:\laragon5\www\probelian\node_modules\vite\dist\node\chunks\dep-689425f3.js:62014:17)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
My environment:
npm -v => 8.19.2
node -v => 18.7.0
yarn -v => 1.22.19
vite.config.ts
import { defineConfig } from 'laravel-vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
server: {
watch: {
ignored: ['**/.env/**'],
},
},
resolve: {
alias: {
"vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js"
}
}
}).withPlugins(
vue
)
Please or to participate in this conversation.