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

folium's avatar

vite.createFilter is not a function

Hello , i have installed fresh laravel 9 application i want to setup vue with the project for that i have done the following steps:

  1. npm install
  2. npm install vue@next vue-loader@next
  3. npm install @vitejs/plugin-vue

vite.config.js :

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


export default defineConfig({
    plugins: [
        vue(),
        laravel([
            'resources/css/app.css',
            'resources/js/app.js',
        ]),
    ],
});

Problem: everything is going perfect until i run (npm run dev) command when i ran it the following error comes:

failed to load config from F:\image_uploads\vite.config.js
error when starting dev server:
TypeError: vite.createFilter is not a function
    at vuePlugin (F:\image_uploads\node_modules\@vitejs\plugin-vue\dist\index.cjs:2395:23)
    at Object.<anonymous> (F:\image_uploads\vite.config.js:33:35)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.require.extensions.<computed> [as .js] (F:\image_uploads\node_modules\vite\dist\node\chunks\dep-c9998dc6.js:61998:20)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at loadConfigFromBundledFile (F:\image_uploads\node_modules\vite\dist\node\chunks\dep-c9998dc6.js:62006:17)
    at loadConfigFromFile (F:\image_uploads\node_modules\vite\dist\node\chunks\dep-c9998dc6.js:61925:32)

if anyone have faced this issue then plz reply any solution.

Thanks.

0 likes
7 replies
folium's avatar

@Sinnbeck yes here is my package.json file :

{
    "private": true,
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "axios": "^0.25",
        "laravel-vite-plugin": "^0.4.0",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "vite": "^2.9.11"
    },
    "dependencies": {
        "@vitejs/plugin-vue": "^3.0.1",
        "vue": "^3.2.36",
        "vue-loader": "^17.0.0"
    }
}

Sinnbeck's avatar

@folium but the api of the plugin might have changed and therefor fail. Can you at least try?

1 like

Please or to participate in this conversation.