Skip to content

"You are using the runtime-only" Warning on version 2.2.0 #83

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

Closed
asafyish opened this issue Sep 15, 2017 · 21 comments
Closed

"You are using the runtime-only" Warning on version 2.2.0 #83

asafyish opened this issue Sep 15, 2017 · 21 comments

Comments

@asafyish
Copy link

Version

2.2.0

Vue.js version

2.4.4

What is exptected?

To not get this warning, as it was in version 2.1.3

What is actually happening?

I am getting a warning:
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

found in

--->

How to repreduce this problem?

Create a version using:

vue init webpack my-project

with runtime-only configuration.

@a-kriya
Copy link
Contributor

a-kriya commented Sep 16, 2017

That error is unrelated to this component (you will see the same warning even with v2.1.3 if you don't change anything else). Here.

@asafyish
Copy link
Author

@Syn-zeta I am aware of this vue behavior and that's not the case.
I verified multiple times, on versoin 2.2.0 I am getting the warning, on version 2.1.3 I am not - nothing else changed.

@asafyish
Copy link
Author

I am actually pretty sure it's from commit 6168c31.

@a-kriya
Copy link
Contributor

a-kriya commented Sep 16, 2017

My bad for the wrong assumption. Moving out the spinners to its own component in a .vue file should fix this issue (and also reduce the bloat in the main component).

@PeachScript
Copy link
Owner

PeachScript commented Sep 17, 2017

My mind is the spinners just need template, so use the local registration may be better, is this problem caused by the local registration of component?

@asafyish
Copy link
Author

asafyish commented Sep 17, 2017

The warning is happening on usage, not on registration. I am registering infinite-loader just once, globally, in my main.js:

import VueVirtualScroller from 'vue-virtual-scroller/dist/vue-virtual-scroller';
Vue.use(VueVirtualScroller);

And then, each time I am using a component, I am getting the warning.

@Jussiadev
Copy link

Jussiadev commented Sep 18, 2017

I have the same problem also in the basic example
#87

@Jussiadev
Copy link

@asafyish Hey. I have the same problem. Have you found a solution?

@PeachScript
Copy link
Owner

@Jussiadev @asafyish you can use Runtime + Compiler build of Vue.js to solve this temporarily, and could you tell me the reason that you want to the Runtime-only build of Vue.js?

@asafyish
Copy link
Author

@PeachScript I was mistaken. I am registering vue-infinite-loading in a local component, not global and still getting the warning.

@Jussiadev No solution so far. The right solution is probably a fix in the library itself.

@Jussiadev
Copy link

@PeachScript why this happens even I use your base example

@PeachScript
Copy link
Owner

@asafyish @Jussiadev perhaps I did not make it clear.

This component use the local registration component as the spinners, and the local registration component was not be pre-compiled when this component be released, but your project use the Runtime-only build version of Vue.js, it does not include the template compiler, the warning will be thrown when the Vue.js try to render a uncompiled template.

So there has a temporary solution to solve it, just change your Vue.js version from Runtime-only to Runtime + Compiler, simply to do it in your webpack configurations:

...
resolve: {
  alias: {
    'vue$': 'vue/dist/vue.esm.js'
  }
}
...

@asafyish
Copy link
Author

@PeachScript Yeah that's a great temporary solution, but long-term, I think it's better not to mandate including the compiler in addition to the runtime.

@PeachScript
Copy link
Owner

@asafyish of course! I will replace all spinners templates with the compiled templates in the next version.

@PeachScript
Copy link
Owner

Hi @asafyish @Jussiadev , the new version v2.2.1 has been released, includes this fix, you can try it now.

@Jussiadev
Copy link

@PeachScript Thank you so much.
Sorry, that is off topic, but how to hide the spinner

@PeachScript
Copy link
Owner

PeachScript commented Sep 25, 2017

@Jussiadev it does not matter, they are same problem.

You can create an empty element to hide the spinner through slot feature.

@asafyish
Copy link
Author

Can verify that it's working correctly in 2.2.1.

@Jussiadev
Copy link

@PeachScript Does not help

<infinite-loading @infinite="infiniteHandler" spinner="circle">
                <span slot="slot"></span>
            </infinite-loading>

@asafyish
Copy link
Author

asafyish commented Sep 25, 2017

Do you mean ?

<infinite-loading @infinite="infiniteHandler" spinner="circle">
  <span slot="spinner"></span>
  </infinite-loading>

notice the slot name.

@Jussiadev
Copy link

@asafyish Thank you. Now it works

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

No branches or pull requests

4 participants