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

SlippinJimmy's avatar

Laravel 10 - Vite keep getting error " Could not auto-determine entry point"

Hello,

I'm currently trying to set up a new Laravel 10 project, with Vite. The project is creating from scratch, it's not an update from a previous Laravel version. I'm running it with Wampserver and a virtual host (maybe it's important in this case). Thing is I'm having a hard time with Vite and can't find any answer to my problem. When I use the npm run dev, I keep getting the same error :

(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.

  VITE v4.1.2  ready in 564 ms

  ➜  Local:   localhost:5173
  ➜  Network: use --host to expose
  ➜  press h to show help

  LARAVEL v10.0.3  plugin v0.7.4

  ➜  APP_URL: sortilegeslaravel10

I think because of the "Could not auto-determine entry point...", my resources are not built. Note that it works fine with npm run build.

I thought maybe it's because my APP_URL was not the same as the Local from Vite ? Therefore, I tried to add in my Vite config file :

server: {
    host: 'sortilegeslaravel10',
},

...And the Local address of Vite changed as intended, but the error persists. My node is up to date. Node is 18.14.0, npm is 9.5.0. Do you have any idea? Thanks.

0 likes
14 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Show your full vite config

SlippinJimmy's avatar

This one :

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    server: {
        host: 'sortilegeslaravel10',
    },
    plugins: [
        laravel({
            input: [
                'resources/assets/sass/global.scss', 
                'resources/assets/sass/default.scss'],
            refresh: true,
        }),
    ],
});

Inputs are ok since the "npm run build" works properly.

SlippinJimmy's avatar

@Sinnbeck Oh, you're right, I forgot the app.js. With it as input the message disappears but it still don't build.

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    server: {
        host: 'sortilegeslaravel10',
    },
    plugins: [
        laravel({
            input: [
                'resources/assets/js/app.js', 
                'resources/assets/sass/global.scss', 
                'resources/assets/sass/default.scss'],
            refresh: true,
        }),
    ],
});
SlippinJimmy's avatar

@Sinnbeck When "npm run build", no error message, everything is properly built in "public/build/assets/". If "npm run dev", Vite server is running properly but nothing happen, no build :

 VITE v4.1.2  ready in 480 ms

  ➜  Local:   sortilegeslaravel10:5173
  ➜  Network: 192.168.1.20:5173
  ➜  press h to show help

  LARAVEL v10.0.3  plugin v0.7.4

  ➜  APP_URL: sortilegeslaravel10
Sinnbeck's avatar

@SlippinJimmy that's how it should work. Dev mode starts a dev server. It does not compile any files. So open your browser like normally and start working

SlippinJimmy's avatar

@Sinnbeck Thank you very much for your time. Vite is new to me and I don't totally get how it works compare to webpack. I put the thread as solved but I think I just go back to mix. When referencing my sass via @vite in blade, it doesn't translate to css for whatever reason, even following other thread discussing it. Moreover, I have static assets / images and it seems tricky to just make everything work properly with versioning. Documentation seems to be missing for the moment, I think I'll just wait it to be more mature.

Sinnbeck's avatar

@SlippinJimmy yeah its a shift as it works very different. Webpack always compiles to static files and then the browser download those files. Vite only does this when building. When doing dev it starts a small websocket server that sends the compiled css and js directly to the browser instead of writing to files. So when you change a file it just injects the change into the browser. This makes it extremely fast and for me webpack takes 1-2 seconds to recompile on every change. Vite takes a few mili seconds

But use webpack/mix if you prefer. It's all about personal preference

1 like
SlippinJimmy's avatar

@Sinnbeck I finally decided not to give up with Vite. After a time, I succeeded to manage a configuration that suits to me (with Sass, JS, images). I think it's worth it. For the moment, I think what is missing the most is the possibility to copy statics assets to the public folder. I use vite-plugin-static-copy for that but it's not native. But anyway, just to say thank you for the explanation and help. ^^

Sinnbeck's avatar

@SlippinJimmy happy to help. And yes it's a bit lacking in features but more gets added all the time (in plugins)

Aminium's avatar

hi i have same error its give me page not found and same error message

Aminium's avatar

i create laravel react inertia app and all thing work fine but when i add new post component page it give me error 404 and error message : (!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.

Aminium's avatar

this is my vite.config.js​

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

export default defineConfig({
    plugins: [
        laravel({
            input: 'resources/js/app.jsx',
            refresh: true,
        }),
        react(),
    ],
    resolve: {
        alias: {
            ziggy: 'vendor/tightenco/ziggy/dist',
            // 'vendor/tightenco/ziggy/dist/vue.es.js' if using the Vue plugin
        },
    },
    
});
​```

Please or to participate in this conversation.