Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not auto-determine entry point from rollupOptions

I'm trying to dockerize a frontend app which was created using vite and vue3. It is not working as a container. Here is the error response.

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

VITE v3.2.4  ready in 191 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: http://172.17.0.2:5173/
(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.

Dockerfile

# base image
FROM node:16.3.0-alpine

# set working directory
WORKDIR /app

# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# install and cache app dependencies
COPY package.json /app/package.json
RUN npm install
RUN npm install @vue/[email protected] -g
# start app
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]

vite.config.ts

export default defineConfig({
    plugins: [vue(), vueJsx()],
    resolve: {
        alias: {
            '@': fileURLToPath(new URL('./src', import.meta.url))
        }
    },
    build: {
        rollupOptions: {
            input: {
                main: resolve(__dirname, 'index.html'),
            }
        }
    }

})

index.html exist in the same directory with vite.config.ts and .Dockerfile. Thanks in advance.

like image 734
krezus Avatar asked Nov 16 '25 21:11

krezus


2 Answers

You are probably using the command yarn dev run instead of yarn run dev to run the dev server

like image 138
Dot_Wayne Avatar answered Nov 19 '25 13:11

Dot_Wayne


This error usually occurs when your css or js files are missing from the specified folder. Like for example in your viteconfig.js file. it always look like this

   plugins: [
    laravel({
        input: [
            'resources/css/app.css',
            'resources/js/app.js',
           ],
        refresh: true,
       }),
    ],

Confirm if those files are in the right place or if you've moved them to a folder like public then you need to update here to

 plugins: [
    laravel({
        input: [
            'public/css/app.css',
            'public/js/app.js',
           ],
        refresh: true,
       }),
    ],
like image 33
Kipruto Avatar answered Nov 19 '25 14:11

Kipruto