Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component provided template option but runtime compilation is not supported in this build of Vue #8

Closed
philippeluickx opened this issue Feb 27, 2021 · 14 comments

Comments

@philippeluickx
Copy link

I am running into this warning (and no component) on a pretty clean install for vue3 with TS.

[Vue warn]: Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js". 
  at <Anonymous> 
  at <VueFeather type="feather" > 
  at <Login onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< 
Proxy { <target>: {…}, <handler>: {…} }
 > > 
  at <RouterView> 
  at <App>
@fengyuanchen
Copy link
Owner

It is a Vue bundled file problem, please check out Explanation of Different Builds of Vue 3.


In short, use:

import { createApp } from 'vue/dist/vue.esm-bundler';

instead of :

import { createApp } from 'vue/dist/vue.runtime.esm-bundler';

@adidesember
Copy link

adidesember commented Mar 4, 2022

thanks, it's work for me

@azzazkhan
Copy link

@fengyuanchen Is there a type declaration for this file? Because TS yells at me when I use it.

@fengyuanchen
Copy link
Owner

@adidesember
Copy link

It is a Vue bundled file problem, please check out Explanation of Different Builds of Vue 3.

In short, use:

import { createApp } from 'vue/dist/vue.esm-bundler';

instead of :

import { createApp } from 'vue/dist/vue.runtime.esm-bundler';

thanks, it works for me
image

@patanvadiya
Copy link

patanvadiya commented Oct 14, 2022

yes it **

import { createApp } from 'vue/dist/vue.runtime.esm-bundler

**'; working

@AsimpleUA
Copy link

Just add additional config to vue.config.js:
image

@zaos22
Copy link

zaos22 commented Jan 1, 2023

@fengyuanchen legend!!

@ARBS23
Copy link

ARBS23 commented Mar 24, 2023

Just add additional config to vue.config.js: image

Perfect!
Worked for me, Thanks

@Speuce
Copy link

Speuce commented May 29, 2023

For others who also are trying to do this in nx, or using webpack, just set your configure-webpack.js to

module.exports = {
  resolve: {
    alias: {
      'vue$': 'vue/dist/vue.esm-bundler.js',
    },
  },
};

@ianjamieson
Copy link

I had the same issue while trying to upgrade from vue2 to vue3, the migration guide suggested I should be using @vue/compat. So in fact my alias should look like this:

resolve: {
    alias: {
        vue: '@vue/compat/dist/vue.esm-bundler',
    }
},

@HannahNguyen6729
Copy link

It is a Vue bundled file problem, please check out Explanation of Different Builds of Vue 3.

In short, use:

import { createApp } from 'vue/dist/vue.esm-bundler';

instead of :

import { createApp } from 'vue/dist/vue.runtime.esm-bundler';

thanks a lot, it works for me

@yinkeli
Copy link

yinkeli commented May 12, 2024

I have tried many configuration methods to modify vite.config.js,

resolve: { alias: { vue: "vue/dist/vue.esm-bundler.js" } },
runtimeCompiler: true,

but there is no effect, still an error
**runtime-dom.esm-bundler-c98336b7.js:1598 [Vue warn]: Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js". **

@Stepykun
Copy link

Stepykun commented Aug 1, 2024

@yinkeli same for me. Did you find any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests