vue3-runtime-template icon indicating copy to clipboard operation
vue3-runtime-template copied to clipboard

use with vite

Open LittleTom opened this issue 2 years ago • 2 comments

you need to edit vite.config.js like this:

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

// https://vitejs.dev/config/
export default defineConfig({
    resolve: {
        alias: {
            vue: 'vue/dist/vue.esm-bundler.js'
        }
    },
  plugins: [
      vue()
  ]
})

LittleTom avatar Apr 19 '22 21:04 LittleTom

Hi! When using my own components, I get a warning:

[Vue warn]: Failed to resolve component
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.

Using composition api How can it be solved?

MaximSedov avatar May 16 '22 09:05 MaximSedov

Hi @MaximSedov, I know this is few months old now, are you still having this issue? I believe this has to with Vite not understanding what the components are. Are your components in a separate component library that you are attempting to link to your project? I was seeing this when attempting to add our lib as a linked dependency. Could you please post your vite.config.js and package.json?

Soundkage avatar Jul 15 '22 11:07 Soundkage

This doesn't work with SSR

henrikruscon avatar Jan 15 '23 15:01 henrikruscon

This doesn't work with SSR

My project can work with ssr. Maybe you can show more detail.

LittleTom avatar Jan 15 '23 19:01 LittleTom

This doesn't work with SSR

My project can work with ssr. Maybe you can show more detail.

SSR fails on Could not load vue/dist/vue.esm-bundler.js/server-renderer using the above method

henrikruscon avatar Jan 18 '23 16:01 henrikruscon